一个完整、安全的PHP用户登录系统
$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: ".
"nnhttp://www.company.com/account/confirm.php?hash=$hash&email=". urlencode($email). "nnOnce you confirm, you can use the services on PHPBuilder.";
mail ($email,'Registration Confirmation',$message,'From:
}
?>
关注此文读者还看过





