Forum Moderators: coopster
What i want to do is to generate an rand hexade(unique identifer) from the email validation into the persons email box for which they should click on to registrar......
<?
function checkEmail($email) {
if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]",
$email)) { return FALSE; } list($Username, $Domain) = split("@",$email);
if(getmxrr($Domain, $MXHost)) { return TRUE;
} else {
if(fsockopen($Domain, 25, $errno, $errstr, 30)) {
return TRUE;
} else {
return FALSE; }
if(checkEmail($_POST['email']) == FALSE){
echo" Sorry E-mail entered
is not valid.";
} else {
echo "Success - please go to your email and click
on the link to registrar!."; } }}
?>
www.example.com/confirm/abcde12345/1000
where "abcde12345" represents the random string and "1000" represents the ProfileId.
I then use a mod_rewrite (actually this is on IIS so it is a 404 error handler) to handle all requests into the "confirm" directory. That code extracts the random string and the ProfileId and does a lookup in the DB. This is a dual-key approach that requires both pieces of information to match.
$code = md5($email."some_fixed_but_secret_string");Then, when they come back and type/pass in the string you can test it as
if (md5($email."some_fixed_but_secret_string")==$what_they_entered)) then validate();
If the string is too long for your liking, just snip off the first half a dozen letters and use them