CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 forget password

Print topic Send  topic

Author Message
amateur_coder

Posts: 35
Posted: 03/19/2007, 4:09 PM

does anyone know how to create a forget password file that will send the user their password by email?
thanks
View profile  Send private message
Damian Hupfeld
Posted: 03/20/2007, 3:33 AM


example in an external file -


  
<?php  
  
$DatabaseName = "db";  
$DbHostName = "localhost";  
$DbUserName = "user";  
$DbPassWord = "pass";  
$userDatabase = "user_table";  
$admin_email = "Damian <damian.hupfeld@itng.com.au>";  
$inSendEmail = $sendEmail; // 1 if 2nd entry  
?>  
<body bgcolor='#FFFFFF' link="#003366" alink="#003366" vlink="#003366"   
text="#000000">  
<link rel="stylesheet" type="text/css" href="Styles/Sagem/Style.css">  
<table width='400' align='center' border='0'>  
<tr valign='top'>  
<td align="center"></td></tr>  
<tr><td align="center">  
<?  
if ($inSendEmail == "") // ask for email  
{  
?>  
<h2>Password Recovery</h2>If you have forgotten your password please enter   
your email address and we will resend you your password.<br><form   
method="post" action="password.php">  
<input type="hidden" value="1" name="sendEmail">  
<span class="nexthostWhite">Enter your Email: </span>  
<input type="text" value="" name="email"><BR><BR>  
<input type="image" src="Styles/Sagem/Images/en/ButtonUpdate.gif"   
value="Send My Password" name="Send My Password">  
</form>  
<?  
}  
else // email password  
{  
mysql_connect($DbHostName,$DbUserName,$DbPassWord) or die("Failure to  
communicate with database") ;  
mysql_select_db($DatabaseName) ;  
  
$result = mysql_query("select sagem_pass FROM $userDatabase WHERE  
sagem_email='$email'");  
while ($row = mysql_fetch_row($result)) {  
$password = $row[0];  
if ($password <> "") {  
  
mail("$email", "$title Sagem Connections - Password Reminder", "You or -   
someone else - has requested that your password be resent to you. \r\n  
Your password is: $password \r\n  
Thankyou for visiting www.sagemconnect.com - hope to see you again   
soon.","From: $admin_email") or die("Error. The program  
was unable to send email.");  
echo "<img src='images/sagemlogo2.png'><br><span>Your password has been sent   
to your  
email address - <a href='Login.php'><b>please check your email and   
<u>Login</u></b></a></span>";  
}  
}  
mysql_close();  
  
if ($password == "") {  
echo "<img src='images/sagemlogo2.png'><br><a href='Login.php'>No password   
has been found for this email, please  
try again or you can <u>register from the home page</u>.</a>";  
}  
}  
echo "</td></tr></table><BR>";  
?>  
  




"amateur_coder" <amateur_coder@forum.codecharge> wrote in message
news:545ff26234a267@news.codecharge.com...
> does anyone know how to create a forget password file that will send the
> user
> their password by email?
> thanks
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

amateur_coder

Posts: 35
Posted: 03/22/2007, 9:55 AM

<form
method="post" action="password.php">
<input type="hidden" value="1" name="sendEmail">
<span class="nexthostWhite">Enter your Email: </span>
<input type="text" value="" name="email"><BR><BR>
<input type="image" src="Styles/Sagem/Images/en/ButtonUpdate.gif"
value="Send My Password" name="Send My Password">
</form>
why do you send the form to the password.php? haven't you determine to mail the user in the forgetpassword.php file?
if not, what's in the password.php?
View profile  Send private message
amateur_coder

Posts: 35
Posted: 03/22/2007, 10:16 AM

never mind i found it...

thank you so much Damian Hupfeld
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.