I created a single table database, i have an ndex.php and login.php. I am using WAMP & dreamweaver, the server testing connection is correct as seen in my dreamweaver Local File menu.
I checked several times the ndex.php is correct but when i fill it and submit (Login) the login.php displays a blank page, it does not echo any error message or connection massage.
these are the codes;
PHP Code:
ndex.php
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form method="post" action="login.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong> </strong></td>
</tr>
<tr>
<td colspan="3"><strong>Member Login </strong></td>
</tr>
<tr>
<td width="78">Username</td>
<td width="6">:</td>
<td width="294"><input type="text" name="username"></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input type="password" name="password" ></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" value="Login"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
login.php
<?
$username = $_POST["username"];
$password =$_POST["password"];
if($username&&$password)
{
$connect= mysql_connect("localhost" , "root", "") or die("Couldn't connect!");
msql_select_db("phplogin") or die ("couldn't find db");
$query = mysql_query(" SELECT * FROM users WHERE username='$username' ");
$results = mysql_fetch_array("$query");
echo $numrows;
}
else
die("Please enter a username and a password!");
?>