<?php
if (!$email || !$pass) {
print "Please fill out all fields.";
include("foot.php");
exit;
}
$logres = mysql_num_rows(mysql_query("select * from players where email='$email' and pass='$pass'"));
if ($logres <= 0) {
print "Login failed. If you have not already, please signup. Otherwise, check your spelling and login again.";
include("foot.php");
exit;
} else {
session_register("email");
session_register("pass");
print "Welcome. <meta http-equiv=refresh content=0;URL=updates.php> If you are not redirected to our city please click <a href=updates.php>here</a> to continue..";
}
?>
<?php include("foot.php"); ?>
And when i try to log in i get the "Please fill out all fields"
I noticed you never retrieve $email or $pass from $_POST, this will fail if register globals is off. Also, from your query I noticed that you are storing raw passwords in your database. You should hash your passwords before sending them to the database.
if (!$email || !$pass) {
print "Please fill out all fields.";
include("foot.php");
exit;
}
$logres = mysql_num_rows(mysql_query("select * from players where email='$email' and pass='$pass'"));
if ($logres <= 0) {
print "Login failed. If you have not already, please signup. Otherwise, check your spelling and login again.";
include("foot.php");
exit;
} else {
session_register("email");
session_register("pass");
print "Welcome. <meta http-equiv=refresh content=0;URL=updates.php> If you are not redirected to our city please click <a href=updates.php>here</a> to continue..";
}
?>
I added the code to retrieve the email and pass from post. I also added quotes to your input field attributes in your form.
Regarding the password hashing. You shouldn't store or transmit raw password, instead you can use a hash function like sha1 to encode them. You store the encoded password in your database. When a user enters their password you encode it and compare it to the already encoded password in the database.