0810
11-12-2002, 10:36 PM
hi how are you doing?
I try to run this script whihc is forget password.
Let's say one forgets his password. and then he typed his e-mail in my form. And He will get password in his e-mail.
my script is not working. Could you check it out for me
my php is 4.23
here is my script
<?php if(isset($_POST["formSubmitted"]=="yes"))
{
$con=mysql_connect("localhost,","itohideo_hide","0810") or die("can't connect");
$db=mysql_select_db("itohideo_japan",$con) or die("can't find your database");
$password=$_POST["password"];
$mail=$_POST["mail"];
$sql="select password from kk where mail='$mail' ";
$result=mysql_query($sql,$con) or die("couldn't execute query");
if(mysql_num_rows($result)==0){
echo"your E-mail is incorrect. Please try again.";
}
if($row=mysql_fetch_array($result)==$mail)
{
$pssword=$_POST["password"];
$subject=$_POST["subject"];
$msg=$_POST["msg"];
$subject="Your password from itohideo.com";
$msg="Here is the password. Do not forget it!";
mail($password, $subject, $msg);
echo "<center>Thank you. You will get password in your e-mail.";
}
}
?>
<html>
<body>
Forget Password:
<form actoin="<?php $_SERVER['PHP_SELF'];?>" method="post">
E-mail Address:<input type="text" size="30" name="mail">
<input type="submit" name="submit" value="submit"><input type='hidden' name='formSubmitted' value='yes'><br>
<input type="button" name="reset" value="reset"><br>
</form>
</body>
</html>
I try to run this script whihc is forget password.
Let's say one forgets his password. and then he typed his e-mail in my form. And He will get password in his e-mail.
my script is not working. Could you check it out for me
my php is 4.23
here is my script
<?php if(isset($_POST["formSubmitted"]=="yes"))
{
$con=mysql_connect("localhost,","itohideo_hide","0810") or die("can't connect");
$db=mysql_select_db("itohideo_japan",$con) or die("can't find your database");
$password=$_POST["password"];
$mail=$_POST["mail"];
$sql="select password from kk where mail='$mail' ";
$result=mysql_query($sql,$con) or die("couldn't execute query");
if(mysql_num_rows($result)==0){
echo"your E-mail is incorrect. Please try again.";
}
if($row=mysql_fetch_array($result)==$mail)
{
$pssword=$_POST["password"];
$subject=$_POST["subject"];
$msg=$_POST["msg"];
$subject="Your password from itohideo.com";
$msg="Here is the password. Do not forget it!";
mail($password, $subject, $msg);
echo "<center>Thank you. You will get password in your e-mail.";
}
}
?>
<html>
<body>
Forget Password:
<form actoin="<?php $_SERVER['PHP_SELF'];?>" method="post">
E-mail Address:<input type="text" size="30" name="mail">
<input type="submit" name="submit" value="submit"><input type='hidden' name='formSubmitted' value='yes'><br>
<input type="button" name="reset" value="reset"><br>
</form>
</body>
</html>