I have this login function, but it returns me a blank page when I tried to login. This is the first form
<form name="form1" method="post" action="checklogin.php">
<input type="hidden" name="action" value="login">
<input type="hidden" name="hide" value="">
<table class='center'>
<tr><td>Username:</td><td><input type="text" name="username"></td></tr>
<tr><td>Password:</td><td><input type="password" name="password"></td></tr>
<tr><td> </td><td><input type="submit" value="Enter"></td></tr>
<tr><td colspan=2> </td></tr>
<tr><td colspan=2>Don't have an admin account yet? Click <a
href="Register.php">here</a>!</td></tr>
<tr><td colspan=2>Thank you for using Sentence Scramble and Sequencer</td></tr>
</table>
</form>
Followed by a php file
<?php
// Connect to server and select databse.
$server = 'localhost';
$username = 'root';
$password = '';
$database = 'project';
mysql_connect($server,$username,$password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
function SignIn ()
{
session_start();
if(!empty($_POST['username']))
{
$query = mysql_query("SELECT * FROM register where myusername = '$_POST[username]'
AND mypassword = '$_POST[password]'") or die(mysql_error());
$row = mysql_fetch_array($query) or die(mysql_error());
if(!empty($row['myusername']) AND !empty($row['mypassword']))
{
$_SESSION['myusername'] = $row['mypassword'];
echo "SUCCESS";
}
else{
echo "sorry";
}
}
}
if(isset($_POST['submit']))
{
login_success.php();
}
?>
'myusername' and 'mypassword' is the elements of the table where user register their username and password into.