PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?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>");
?>
So there it is. Have fun trying to figure it out! The error I'm getting is Parse on Line 22.