$sql="UPDATE user SET email='$email',is_confirmed='1' WHERE confirm_hash='$hash'";
$result=db_query($sql);
return true;
}
} else {
$feedback .= ' HASH INVALID - UPDATE FAILED ';
return false;
}
}
function user_send_confirm_email($email,$hash) {
/*
这个函数在初次注册或改动email地址时利用
*/
$message = "Thank You For Registering at Company.com".
"\nSimply follow this link to confirm your registration: ".
"\n\nhttp://www.company.com/account/confirm.php?hash=$hash&email=". urlencode($email). "\n\nOnce you confirm, you can use the services on PHPBuilder.";
mail ($email,'Registration Confirmation',$message,'From: noreply@company.com');