I'm trying to make a PHP MySQL login form. For some reason the php portion of the code always returns a blank page. When I type in a username or pass, the next page doesn't do what I need it to. I used WampServer to make sure I installed everything correctly. Does anyone know what the problem is?
Thank you so much for any help, it is greatly appreciated!
Here are my codes
userLogin.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body >
<form method="post" action="userLogin.php" >
<table border="1" >
<tr>
<td>
<B>User-Id</B>
</td>
<td><input type="text" name="userid">
</tr>
<tr>
<td><B>Password</B></td>
<td><input name="password" type="password"></input></td>
</tr>
<tr>
<td><input type="submit" value="Submit"/>
<td><input type="reset" value="Reset"/>
</tr>
</table>
</form>
</body>
</html>
userLogin.php
<?php
$f_usr= $_POST["userid"];
$f_pswd= $_POST["password"];
$con=mysql_connect("localhost","root","");
if(! $con)
{
die('Connection Failed'.mysql_error());
}
mysql_select_db("dave",$con);
$result=mysql_query("select * from user");
while($row=mysql_fetch_array($result))
{
if($row["username"]==$f_usr && $row["password"]==$f_pswd)
echo"Welcome";
else
echo"Sorry";
}
?>