or test this one ... not you must modifie it to your spefications!
<?php
$username = $_POST['username'];
include ("../login/mysqlcondbrr.php");
if (!isset($_POST[username])) // they haven't filled out the form yet.
{
?>
<html>
<body><br>
<form action="<?=$PHP_SELF?>" method="post" name="getpass">
<b>Your username:</b>
<br>
<br>
<input class="inputSidebar" type="text" name="username"<br>       
<input class="button" type="submit" name="submit" value="Get password">
</form>
</body>
</html>
<?php
}
else // form has been filled out
{
$mysqlcon1 = "SELECT * FROM reg_info WHERE username='".$_POST[username]."'";
$result1 = mysql_query($mysqlcon1) or die("Error: " . mysql_error());
if (mysql_num_rows($result1) == '1') {
while ($row = mysql_fetch_array($result1)) {
/*****Dont forget this*******/
print "<p><center><big>Welcome $_POST[username] Please click <a href=\"index.php\">
here</a> to continue to flameline.com in some seconds you will recive a email with your password in it.</big></center></p>";
/*******mail function here!***********/
$message = "Your password is ".$row['password']."";
$email = $row['email'];
$mail = mail($email, "Your Password", $message,"From: support@flameline.com\r\n");
if ($mail) {
echo "mail sent to you";
}
}
}
else
{
print "<p><center><big>Sorry, incorrect username ( $_POST[username] ).</big></big></center></p>";
print "<p><center><big>if not a member <a href=\"register.php\">
click here to register</big></center></p>";
}
}
?>