1
ScubaAddict
User Activation Question - Referred by...

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=username

Index2.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!

2
ScubaAddict
Re: User Activation Question - Referred by...

I guess this might be better as a module request - I have posted the request in there as it is probably more appropriate.

Thanks,

Login

Who's Online

280 user(s) are online (185 user(s) are browsing Support Forums)


Members: 0


Guests: 280


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits