KBD

Keith Devens .com

Saturday, November 22, 2008 Flag waving
It's such a fine line between stupid and clever. – David St. Hubbins (This is Spinal Tap)
← More on tabs vs. spacesVisual Studio keyboard shortcuts →

Daily link icon Tuesday, February 7, 2006

My PHP form doohicky library is awesome

My little form doohicky library is awesome (unfortunately, the version up there is pretty old). I know I've molded it into something fairly decent because I just added something to one of my 'actions' and I did what I thought should work, and it actually worked without changes to the library.

What I added was a hidden field in my comment form that tracks the referrer that someone has when he first gets to one of my weblog posts, which will stick with the form through previews and so on and I'll get it when I get my mail notification of the final post. That way, instead of having to look through my log to see where people came from (i.e. search engines or wherever), I'll have it right in my e-mail. Previously, I already got the referrer in my e-mail, but since the actual referrer for the comment submission will always be the same as the page of the weblog post it was pretty useless.

It took all of about 3 lines. 1 to define the field. 2. a condition to set it to the referrer if the field hasn't already been set and if the referrer is set. 3. something to set $_SERVER['HTTP_REFERER'] to that field before my mail gets sent off.

← More on tabs vs. spacesVisual Studio keyboard shortcuts →

Comments XML gif


Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

November 2008
SunMonTueWedThuFriSat
 1
2345678
9101112131415
16171819202122
23242526272829
30 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 5 posts

Recent comments XML

new⇒Ubuntu Nvidia install not working for me... could use a hand

Cant change xorg.conf!

I'm not​the owner of it, don't ask me​why
but it...

I)orogon: Nov 22, 5:41am

Calif. Supreme Court to take up gay marriage ban

I would argue the point is not​definitional.  While the word​marriage is su...

Justin: Nov 20, 4:37pm

Java join function

Meh, don't have null strings in​your string arrays imo, but you're​welcome ...

Keith: Nov 19, 7:51pm

Girls, please don't get breast implants

sorry but another thing i have to​make a comment on about you​men...the men...

happynow: Nov 17, 11:36pm

Books by Vincent Cheung

to all Cheung​fans:

read:

http://www.progin​osko.com/aquascum/cheung.h...

Zamir: Nov 16, 9:07am

Generated in about 0.206s.

(Used 8 db queries)

mobile phone