syntax cleanup

This commit is contained in:
2017-10-22 20:39:20 -07:00
parent bb1051e490
commit 3729258931
109 changed files with 847 additions and 1641 deletions
+15 -26
View File
@@ -2,34 +2,23 @@
include("config.php");
if($_POST['u']!="")
{
$u=addslashes($_POST['u']);
$p=addslashes($_POST['p']);
if($u!="" && $p!="")
{
$sql="SELECT * FROM mrpg_users WHERE name='$u'";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
if($row['password']==$p)
{
$message="You have been logged in. Proceed to <a href='game.php'>the Game.</a><br>";
setcookie("mrpg-ethbnd", strtolower($u . "@seperator@" . $p), time()+525600);
}
else
{
$message="Invalid username or password.";
}
}
}
if($_POST['u']!="") {
$u=addslashes($_POST['u']);
$p=addslashes($_POST['p']);
if($u!="" && $p!="") {
$sql="SELECT * FROM mrpg_users WHERE name='$u'";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {
if($row['password']==$p) {
$message="You have been logged in. Proceed to <a href='game.php'>the Game.</a><br>";
setcookie("mrpg-ethbnd", strtolower($u . "@seperator@" . $p), time()+525600);
} else {
$message="Invalid username or password.";
}
}
}
}
?>
<form action='login.php' method='post'><?php echo $message; ?><table border='0' cellpadding='1' cellspacing='0'><tr><td>Username:</td><td><input type='text' name='u' value='<?php echo $u; ?>'></td></tr><tr><td>Password</td><td><input type='password' name='p' value='<?php echo $p; ?>'></td></tr><tr><td align='center' colspan='2'><input type='submit' value='Login'></td></tr></table></form>