ultrakilla
05-12-2006, 09:00 PM
i have been working on a game, and i am having trouble with the login(i know sad:( , but i'm learning!, and i'm looking for help:thumbsup: ). The login code is posted below! Somebody please reply and help me out.
<html>
<head>
<title>Abeo - checklogin Page</title>
<link rel="icon" href="sword.jpg" type="image/jpg">
<link rel="stylesheet" type="text/css"href="abeo.css">
</head>
<p class="top"><img src="ch1.gif" alt="ch.1 logo" width="512" height="57"></p>
<pre><img src="abeo.gif" alt="Logo" width="534" height="214"></pre>
<pre><a href="login.php">Login</a> <a href="forums/index.php">Forum</a> <a href="index.php">Main</a></pre>
<?php
$username="";
$password="";
$database="abeo";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$user=$_POST['user'];
$pass=$_POST['pass'];
$email=$_POST['email'];
$sql="SELECT * FROM user WHERE user='$user' and pass='$pass' and email='$email'";
$row = mysql_fetch_assoc(mysql_query($sql));
if( $row['user']==$user && $row['pass']==$pass){
setcookie("user", $user, time()+1800);
?>
<META HTTP-EQUIV="Refresh" CONTENT="0"; URL="controlcenter.php">
<?php
}
else{
?>
<pre>Could not log in!<pre>
<?php
}
?>
<pre><FORM><INPUT TYPE="BUTTON" VALUE="Try Again" ONCLICK="history.go(-1)"></FORM></pre>
</html>
<html>
<head>
<title>Abeo - checklogin Page</title>
<link rel="icon" href="sword.jpg" type="image/jpg">
<link rel="stylesheet" type="text/css"href="abeo.css">
</head>
<p class="top"><img src="ch1.gif" alt="ch.1 logo" width="512" height="57"></p>
<pre><img src="abeo.gif" alt="Logo" width="534" height="214"></pre>
<pre><a href="login.php">Login</a> <a href="forums/index.php">Forum</a> <a href="index.php">Main</a></pre>
<?php
$username="";
$password="";
$database="abeo";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$user=$_POST['user'];
$pass=$_POST['pass'];
$email=$_POST['email'];
$sql="SELECT * FROM user WHERE user='$user' and pass='$pass' and email='$email'";
$row = mysql_fetch_assoc(mysql_query($sql));
if( $row['user']==$user && $row['pass']==$pass){
setcookie("user", $user, time()+1800);
?>
<META HTTP-EQUIV="Refresh" CONTENT="0"; URL="controlcenter.php">
<?php
}
else{
?>
<pre>Could not log in!<pre>
<?php
}
?>
<pre><FORM><INPUT TYPE="BUTTON" VALUE="Try Again" ONCLICK="history.go(-1)"></FORM></pre>
</html>