Game!
Posted: Mon Mar 15, 2004 10:02 am
Let's play a little game of find the error, shall we? This is my login processing script, which *kicks the script* refuses to work.
So there it is. Have fun trying to figure it out! The error I'm getting is Parse on Line 22.
Code: Select all
<?php
$host = "localhost";
$dbusername = "DBUSERNAME";
$password = "DBPASS";
$database = "DB";
$server = mysql_connect($host, $dbusername, $password) or die(mysql_error());
$rs = mysql_select_db($database , $server);
$username = $HTTP_POST_VARS['txtName'];
$password = $HTTP_POST_VARS['txtPassword'];
$rs = mysql_query("SELECT * FROM Members WHERE Name = '$username' AND Password = '$password' ");
//if the user exists
if (mysql_num_rows($rs)>0)
{
//make a cookie for the user
setcookie("loginname",$username);
}
if (mysql_num_rows($rs)>1)
{
echo("You have not registered. <a href="join.php">Click here to register</a>");
?>