Because i ve not been able to resolve my previous problems, i decided to go in for something simple. 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;
Please helpCode:[B]ndex.php[/B]
[code]
<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>
[/code]
[B] login.pho [/B]
[code]
<?
$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' ");
$numbers = mysql_num_rows("$query");
echo $numbers;
}
else
die("Please enter a username and a password!");
?>
[/code]
thx:
Last edited by efim; 02-10-2010 at 10:45 AM. Reason: Please use code tags when posting code!
should beCode:$numbers = mysql_num_rows("$query");
Code:$numbers = mysql_num_rows($query);
Thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks