hello,
ive recently created a login in and register page for a website im working on and when using the register.php page to sign up, then entering the details into the login.php page all the login page seems to be doing is refreshing and removing the entered information and not moving onto the next page, im not sure on the problem if anyone can help or suggest anything.
below is the login.php script:
login.php script:
<?php
require('config.php');
if (isset ($_POST['submit'])){
$uname = mysql_escape_string($_POST['uname']);
$pass = mysql_escape_string($_PASS['pass']);
$pass = md5($pass);
$sql = mysql_query("SELECT * FROM `tut` WHERE `uname` = '$uname' AND `pass` = '$pass'");
if(mysql_num_rows($sql) > 0){
echo"You are now logged in";
exit();
}else{
echo"Wrong Username or Password";
}
}else {
$form = <<<EOT
<form action="login.php" method="POST">
Username: <input type="text" name="uname"/><br />
Password: <input type="password" name="pass"/><br />
<input type="submit" name"submit" value="Log In"/>
</form>
EOT;
echo $form;
}
?>