I just finish to read the excellent article about the jokes program and I'm in the mood for programming :) My question is about http_referer. I create a "recommand this page to a friend" but I freeze with my http_referer code.
On my form I have $referer = getenv("HTTP_REFERER"); so now I'm ok, I have the referer but my problem is to insert this http_referer into my database. I need 2 script, so I cannot use the php_self. I have the form from which I get the http_referer and my other script recommand_it.php3 to insert the info into the table. But as soon that I press the submit button I have for referer the name of my form :(
I need a solution on how to fix my problem.
I someone know a good tips or sample code please let me know!
I'm not sure I understand your question... If you want someone to be able to type a value and pass it to recommand_it.php3, you can just use a simple form:
Since this is covered pretty thoroughly in the article to which you refer, I'm assuming you're asking something more complex. I just can't figure out what.
<FORM ACTION="recommand_it.php3" METHOD=POST>
<INPUT TYPE=TEXT NAME="varName">
use hidden field
<INPUT NAME="referer" TYPE="HIDDEN" VALUE="whatever referer is">
and then when sending that form read $referer you are there