Hi,
the code below is live at:
www.activityx.co.uk/dynamic/activate.php
a URL you can use to see a live example is:
http://www.activityx.co.uk/dynamic/a....php?u=1&key=d
It is an activation script for when a user signs up, if they use the wrong code they are able to input their email address again and a new code will be sent out.
The problem I am having is, when they input the incorrect email, it displays the correct message BUT if they input the correct email, it times out??
You can use email: tom@activityx.co.uk
Thanks
PHP Code:
<?php $emailSQL = "SELECT * FROM `table` WHERE `email` = '$email'"; while($row = mysql_fetch_array($database->getData($emailSQL))) { $id = $row['id']; } if($database->numRows($emailSQL) != 1) { print "<h1>Invalid E-Mail Address</h1>"; print "<p>There seems to be an error in the information you have posted.</p>"; print "<p>Please request a new activation link by typing your email below.</p>";
?> <form action="activate.php" method="post"> <input type="text" name="email" class="email" onclick="this.value='';" onblur="this.value=!this.value?'<?php print $email; ?>':this.value;" value="<?php print $email; ?>" /> <input type="submit" value="Send Activation Code" name="new-code" class="submit" /> </form> <?php } else { $curDir = dirname($_SERVER['PHP_SELF']); $curLoc = $_SERVER['SERVER_NAME']; $url = $curLoc; $url .= $curDir; $key = generateRandomString(20); $activationLinkText = "<a href='http://www.$url/activate.php?u=$lastID&key=$key'>activation link</a>"; $activationLink = "http://www.$url/activate.php?u=$lastID&key=$key"; $fromEmail = "accounts@activityx.co.uk"; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; // More headers $headers .= "From: Activity X<$fromEmail>\r\n"; $headers .= "Reply-To: $fromEmail\r\n"; // send the email print "<p class='main_text' style='text-align:left;'>We have sent a new confirmation e-mail to the address that you supplied (<strong>$email</strong>).</p>"; print "<p class='main_text' style='text-align:left;'>Please follow the link in the e-mail to activate your account.";
} // end else
|