I have a simple form code to pass name and password to "mathresult2006.php".
==========================================
.....
<form action="mathresult2006.php" method="post">
<table>
<tr><td>name: </td><td><input type="text" name="my_name" style='width:130px;'/></td></tr>
<tr><td>Password: </td><td><input type="password" name="my_password" style='width:130px;'/></td></tr>
<tr><td></td><td align=right><input type="submit" /></td></tr>
</table>
</form>
.....
In "mathresult2006.php" one's name and password are compared and if there is a match it will print his math test result on the screen.
==========================================
......
$result = mysql_query("SELECT Year, Place, K_name, Password, Mark FROM math_results_2006",$db);
$match=0;
while ($row=mysql_fetch_array($result, MYSQL_ASSOC))
{
if ($row['K_name']==$POST['my_name'] && $row['Password']==$POST['my_password'])
{
echo "<table>";
echo "<tr><td><p><b>Year:</b></td><td>", $row['Year'],"</p></td></tr>";
echo "<tr><td><p><b>Place:</b></td><td>", $row['Place'],"</p></td></tr>";
echo "<tr><td><p><b>Name:</b></td><td>", $row['K_name'],"</p></td></tr>";
echo "<tr><td><p><b>Mark:</b></td><td>", $row['Mark'],"</p></td></tr>";
echo "</table>";
$match=1;
}
}
......
However it my_password is entirely consists of numbers my_password will be passed as number rather than string e.g. if the password is "00000" it will be passed on as 0.
How can I define my_password as string and pass onto mathresult2006.php as such?
Thank you.
Yon Han CHONG