I'm driving myself crazy trying to figure this out.
Here is what I am trying to do.
Page 1- http://www.test.com/test.php?id=username
I need to store the username in a cookie.
Page 2- http://www.test.com/form.php
I will have a hidden text box that needs to have the value of the cookie.
It is so I can keep track of referrals.
Example: user1 refers someone to my site. The id "user1" gets stored in a cookie. The visitor browses many pages on my site. If the visitor go to the sign-up form page, then a hidden text box will hold the value stored in the cookie, which should be "user1". This way when the information is sent, I can credit user1 for the referral.
This is what I have been trying:
On Page 1 http://www.test.com/test.php?id=user1
<? setcookie("refer","$_GET['id']",time()+36000); ?>
On Sign-up form page
<input type="hidden" name="referrer" value="<? echo $HTTP_COOKIE_VARS["refer"]; ?>">
I hope I don't confuse anyone. It's hard to explain.