php mail probs
Posted: Wed May 14, 2003 4:06 am
i'm trying to make a script to mail the user their password if they lose it, at present i have:
<form method=post" action="index.php">
Enter your email:<br />
<input type="text" name="mailpass" style="style="font-size:10px;border:solid 1px;">
<input type=image src="buttons\send.gif" name=send value="send" style="font-size:10px;">
</form>
<?
if (isset($_POST['mailpass']))
{
$db_conn = mysql_connect("localhost", "cadmin", "cpass");
mysql_select_db("crimson", $db_conn);
$query = "select email from user where username='$valid_user'";
$result = mysql_query($query, $db_conn);
//mail user password
if (mysql_num_rows($result) >0 )
{
$email = $_POST['mailpass'];
$from = "from: Crimson Maurauders \r\n";
$mesg = "You password is $password \r\n";
mail($email, $from, $mesg);
}
}
?>
it's not working atm (
<form method=post" action="index.php">
Enter your email:<br />
<input type="text" name="mailpass" style="style="font-size:10px;border:solid 1px;">
<input type=image src="buttons\send.gif" name=send value="send" style="font-size:10px;">
</form>
<?
if (isset($_POST['mailpass']))
{
$db_conn = mysql_connect("localhost", "cadmin", "cpass");
mysql_select_db("crimson", $db_conn);
$query = "select email from user where username='$valid_user'";
$result = mysql_query($query, $db_conn);
//mail user password
if (mysql_num_rows($result) >0 )
{
$email = $_POST['mailpass'];
$from = "from: Crimson Maurauders \r\n";
$mesg = "You password is $password \r\n";
mail($email, $from, $mesg);
}
}
?>
it's not working atm (