hi, when i use the script for resending the mail when i put a mail that is in the database the script runs smoothly.
but when i put an emal that it isnt on the database it returns a blank page... i dont know where is the error, but, something is wrong
this is the code
PHP Code:
<?php
include 'config.php';
if(isset($_POST['resend']))
{
$email = trim($_POST['email']);
$query = mysql_query("SELECT Actkey FROM Users WHERE Email = '$email' LIMIT 1") or die(mysql_error());
while($row = mysql_fetch_array($query)){
$act = $row['Actkey'];
if(mysql_num_rows($query) > 0)
{
$send = mail($email , "Activate your account" , "Thank you for registering with YourWebsite.\n\nClick the link below to activate your account:\nhttp://CHANGETHISURL.COM/activate.php?id=".$act."\n\nPlease do not reply, this is an automated mailer.\n\nThanks", "FROM: auto@mailer.com");
if($send){
echo '
<html>
<head>
<title>Success</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<div id="head">the resend activation email page</div>
<br>
<div id="success">
<p>The validation email was successfully sent. <a href="login.php">Click here</a> to login once you have activated.</p>
</div>
</div>
</body>
</html>
';
} else {
echo '
<html>
<head>
<title>Error</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<div id="head">the resend activation email page</div>
<br>
<div id="error">
<p>Ha, what an act. There has been an error processing your activation email. Please contact the administrator.</p>
</div>
</div>
</body>
</html>
';
}
} else {
echo '
<html>
<head>
<title>Error</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<div id="head">the resend activation email page</div>
<br>
<div id="error">
<p>Sorry, your email was not found in the database, please enter an email address that you have registered with and not recieved and email with.</p>
</div>
</div>
</body>
</html>
';
}
}
} else {
?>
<html>
<head>
<title>Resend validation email</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<div id="head">the resend activation email page</div>
<br>
<div id="main">
<p>Ok, so your activation email didn't get sent? DAMN S**T C*H(#@ ((@J no, stop swearing, put that bottle down. You don't need it. We need each other. I'm here to resend your email, so enter your email address, and I will send the validation link to that email, provided you have registered ofcourse, if you are trying to hack me, what a sad guy, taking advantage of my emotions like that... jeez.</p>
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
<p>Email:<br>
<input name="email" type="text">
<p>
<input name="resend" type="submit" id="resend" value="Resend">
</form>
</p>
Once you enter your email and hit resend, I will make sure your email is valid, then send you out your validation link. If it doesn't come, try me again! I'm not a one night stand you know...
<p>By the way, I am very (case) sensitive so enter the email exactly as you registered with it. </p>
</div>
</div>
</body>
</html>
<? } mysql_close($l); ?>
TIA
sorry about my poor english