i have created a feature to email the user their password when they forget it on my site, however i want to write my message for the email and save it as a variable, which calls the 'first_name' of the user from the mysql database table member, to greet them in their email, and then give them their 'password'. Can i use html in the message to present the email better??
Here is the code i have written already:
<?php
if (isset($POST['mailpassword']))
{
$username = $POST['username'];
$message = "Here is your password: " . myrow['password'];
$db = mysql_connect("localhost", "****", "**");
mysql_select_db("the-coff_maitland",$db);
$select = mysql_query("SELECT FROM member WHERE username = '$username';", $db) or die(mysql_error());
if (mysql_num_rows($select) < 1)
{
die("Couldn't find username: $username.");
}
echo "<p class='forgotPassword' align='center'>Your password has been sent to $username</p>";
$myrow = mysql_fetch_array($select);
mail($username, "Password Reminder", $message, "From: Maitland Medical <info@maitlandmedical.co.uk>");
}
?>
Can anyone help me please??
Thanks