Jump to content


Photo

Forgot password mail script messen up :S


  • Please log in to reply
2 replies to this topic

#1 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 02 October 2006 - 10:51 PM

Ok I was coding this forgot password script but for some reason when i send then email it doesn't get the email :S any one know why this is happening:

<? include "header.php"; ?>
<?php
$get_email = mysql_query("SELECT * FROM users WHERE email='$email'") or die(mysql_error());
$email_info = mysql_fetch_array($get_email);
$get_url = mysql_query("SELECT * FROM boardstatus WHERE id='1' ") or die(mysql_error());
$url_info = mysql_fetch_array($get_url);
$email = $_POST['femail'];
$subject = "Forgot Password";
$headers .= 'From: Webmaster <webmaster@noreply.com>' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
$submit = $_POST['sendpass'];
$password = $email_info[password];
$uid = $email_info[id];
$link = $url_info[url]."/validateaccount.php?uid=".$uid."&pass=".$password;
$message = "You have requested to reset your password to do so please visit link and follow steps.\n Visit Link Here: $link \n validate account now. ";

	if(isset($submit))
		{

			if($email_info[email] = false)
				{
					echo "Sorry, but that email is not in our database.";
						exit;
				}
			mail($email,$subject,$message,$headers);
		}elseif(!isset($submit))
			{
?>
<table class='category'>
	<tr>
		<td><b>Forgot Email</b></td>
	</tr>
</table>
<table class='forum'>
	<tr>
		<td><center><form method='post'><input type='text' name='femail'><br /><input type='submit' name='sendpass' value='Send Validation Link'></form></center></td>
	</tr>
</table>
<table class='lastcatrow'>
	<tr>
		<td>&nbsp;</td>
	</tr>
</table>
<? } ?>
<? include "footer.php"; ?>
</body>
</html>

Heres the email:

You have requested to reset your password to do so please visit link and follow steps.
 Visit Link Here: http://*************/nevux1_3_0/validateaccount.php?uid=&pass=
 validate account now


#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 02 October 2006 - 11:15 PM

I suspect that $email = $_POST['femail'] needs to come before the MySQL query. If that's not it, can you ask your question more clearly?
Legend has it that reading the manual never killed anyone.
My site

#3 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 02 October 2006 - 11:21 PM

ROTFL Im dump OMG  :o

thanks for my simply dumb mistake :S




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users