Glemt password (mail form)
<table cellpadding="0" cellspacing="0" style="margin:10px;" width="90%"><?php
if ($_POST['send'] != "" && $_POST['mail'] != "") {
$query = mysql_query("SELECT * FROM members WHERE mail='".$_POST['mail']."'");
$members = mysql_fetch_array($query);
$bruger = $members['user'];
$kode = $members['pass'];
$mail = $members['mail'];
$subject = "Serious Login";
$message = "WWW: http://xg-league.dk/serious/ \n\n Username: ".$bruger." \n Password: ".$kode." \n\n Have fun!";
mail($mail, $subject, $message);
}
?>
<form action="" method="post">
<tr>
<td valign="top" colspan="2"><b>Retrieve password</b>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td><br></td>
</tr>
<tr>
<td>Mail:</td>
</tr>
<tr>
<td><input type="text" name="mail"></td>
</tr>
<tr>
<td><br></td>
</tr>
<tr>
<td><input type="submit" name="send" value="Send password" style="width:84px;"></td>
</tr>
</form>
</table>
</td>
</tr>
<?php
if ($_POST['send'] != "" && $_POST['mail'] != "") {
echo "<tr><td><br></td></tr><tr><td colspan='2'>Password has been sent!</td></tr>";
}
?>
</table>
--------------------------------------
Jeg kan simpelthen ikke forstå, hvad der er galt. Når jeg har trykket på "Send password", skriver den "Password has been sent!", men der kommer ingen mail.
Er der nogen der kan se fejlen?