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/
>
|