An EXTREME smurf
Posted: Mon May 06, 2002 5:10 pm
I'm working on a login script and I've got a table, cm_admin. In the table there are the following fields/values:
id- 1
name - Jim
pass - pass
email - jim@jim.com
This is the login page's code:
Here is the login2.php code:
What the hell is the problem?
Thanks!
id- 1
name - Jim
pass - pass
email - jim@jim.com
This is the login page's code:
Code: Select all
<HTML>
<HEAD><TITLE>Prodigy Login Script v1.1</TITLE></HEAD>
<BODY>
<form method=post action="login2.php">
Name: <input type=text name=name><BR>
Pass: <input type=text name=pass><BR><BR>
<input type=submit value=submit> <input type=reset>
</form>
</BODY>Code: Select all
<?
ob_start();
include("../../clanmanager/config.php");
$sql = "SELECT * FROM cm_admin WHERE name=$name and pass=$pass";
$result = mysql_query($sql) or die ("Unable to get results.");
$num = mysql_numrows($result) or die ("Your Username and/or Password are incorrect. If you feel you have recieved this message in error, please contact the <a href="mailto:website@hot.rr.com">webmaster</a>");
if ($num == 1) {
print("Welcome to ClanManager! You are logged in as $name !");
setcookie("p_user",$username,time()+1209600,"/","maxxxtorque.com","0");
ob_end_flush();
}
print("<BR><BR>Return to <a href="/prodigy">Prodigy</a>");
?>Thanks!