Tick Box

admin

Administrator
Staff member
Hi,
I have a user register form, with a tick box (checkbox) at the bottom, if this is uncecked then the details are only entered into table 'users'if it is checked I want the e-mail address to be entered into table 'newsletter'. I have tried if($signup == 'ON'); in the following code but it doesn't work.

function add_newsletter($user_id,$email,$signup) {
global $feedback,$hidden_hash_var;
$hash=md5($email.$hidden_hash_var);
if($signup == 'ON');
$sql = "INSERT INTO newsletter (user_id,email,remote_addr,confirm_hash,is_confirmed) ".
"VALUES ('$user_id','$email','$GLOBALS[REMOTE_ADDR]','$hash','0')";
$result=mysql_query($sql);
return true;
}

Can anyone help?
 
Back
Top