1
I am not an PHP expert, but I want to add a field to the users DB called "referred_by" (varchar, null).
When a user 'activates' (by pressing the activation link in their email) I want the resulting page to check for a cookie that I set previously and insert it's value into this 'reffered_by' field of the users table.
Basic flow: I am having a contest for who can refer the most users. They can make a link with their user name:
http://www.mysite.com/index2.php?referred_by=usernameIndex2.php will set a cookie:
if (!isset($referring_user)){
setcookie ("referring_user",$referred_by,time()+86400,"/");
}
header("location:
http://www.mysite.com");
?>
So now the cookie just sits until they activate their registration, it's value is inserted into the users table, then the cookie is cleared.
Can anyone help me put the code in to user.php to accomplish getting the cookie value into the db?
Thanks!