i am trying to create a security level for emailing a user their password when they have forgotten it. For this i have assigned each user the field to enter their mother's maiden name for validation when sending them their password over email. The code i have written is below, and the email function works ok, but i keep getting an error on the line of the if statement when comparing the 'secretQuestion' (mother's maiden name) with the text that the user will enter into the box.
I was wondering if someone could help me sort out this parse error.
Thanks
<form action="forgotPassword.php" method="post">
<tr>
<td><p class="password" align="center">Please enter your username: </p></td>
<td><input type="text" size="35" name="username"></td>
</tr>
<tr>
<td><p class="password" align="center">Please enter your mother's maiden name:</p></td>
<td><input type="text" size="35" name="secretQuestion"></td>
</tr>
<tr>
<td><p align="right">(Click here to send password to email address)</p></td>
<td align="center"><input type="submit" name="mailpassword" value="Send"></td>
</tr>
</form>
</table>
<?php
if (isset($POST['mailpassword']))
{
$username = $POST['username'];
$secretQuestion = $_POST['secretQuestion'];
//$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());
$myrow = mysql_fetch_array($select);
if (mysql_num_rows($select) < 1)
{
die("Couldn't find username: $username.");
}
if (("%s", myrow["secretQuestion"]) == $secretQuestion)
{
echo "<p class='forgotPassword' align='center'>Your password has been sent to $username</p>";
mail($username, "Password Reminder", "Here is your password: " . myrow['password'], "From: Maitland Medical <info@maitlandmedical.co.uk>");
}
}
?>