Hi,

I am creating a simple login page for my site, and am having a few problems. Here is the code for my login form (editorloginform.php):

<?php
include "admin_header.php";

echo '<h align="middle"><h1>Editor Login</h1>';
echo"<form action='posslogin2.php' method='POST'>
<table border=0>
<tr>
<td>Username</td>
<td><input size='16' name='username'></td>
</tr>
<tr>
<td>Password</td>
<td><input size='16' type='password' name='password'></td>
</tr>
</table>
<input type='submit' value='Log in'>
</form>";

include "admin_footer.php";
?>


and here is the code for my login script(posslogin2.php) :



<?php
session_start();
include "db_connect";
//get the data used to authenticate users

$username = $_POST['username'];
$password = $_POST['password'];

//perform the query to see if you have a matching result

$sql = mysql_query(
"SELECT username
, password
FROM editors
WHERE username = '$username'
AND password = '$password'
LIMIT 0,1")
or die('<p>Unable to query the database at this time.<br />Error: ' . mysql_error() . '</p>');
$row = mysql_fetch_array($sql);

if(mysql_num_rows($sql) == 1) // if there is one matching result, then get some data to be displayed on your pages for the user logged in.
{
$_SESSION['username'] = $row['username'];
$_SESSION['password] = $row['password'];
$_SESSION['loggedin'] = TRUE; // Setting session var 'loggedin' to true
header('Location:admin.php'); // redirects to the welcome page if everything is ok.
exit;
****
}else{
****header('Location:editorlist.php'); // Redirect to error page.
****exit;
}
?>
php]

When i click on the submit button, I get a blank page. Can anyone help me out?

Thanks,

Sunny