Register script is fine, it drops users into a MySQL database, however to the login script gives me the following error:
Parse error: syntax error, unexpected T_VARIABLE in /hermes/bosweb25a/b109/ipg.removalspacecom/removal space.com/loginscript.php on line 15
I know that there is an error but which one? i basically copied the script word-for-word, letter-for-letter. so how come im getting this one?
Heres the actual script:
<?php $username = $_POST['username'];
$password = $_POST['password'];
$self = $_SERVER['PHP_SELF'];
$referer = $_SERVER['HTTP_REFERER'];
#if either form field is empty return to the log-in page
if( ( !$username ) or (!$paswword ) )
{ header( "Location:$referer" ); exit(); }
#connect to MySQL
$conn = @mysql_connect ( "removalspacecom.ipagemysql.com", "removal", "123" )
or die("Could not connect" );
#select the specified database
$rs = @mysql_select_db( "removal1", $conn )
or die( "Could not select database" )
#create sql query
$sql="select * from users where user_name=\"$username\"
and password = password( \"$password\" )";
#execute query
$rs = myslq_query( $sql, $conn )
or die( "Could not execute query" );
#get number of rows that match username and password
$num = mysql_numrows( $rs );
#if there is a match the log-in is authenticated
if( $num != 0 )
{ $msg = "Welcome $username - your log-in was sucessfull!"; }
else #or return to the log-in page
{ header( "location:$referer" ); exit(); }
?>
<html> <head><title>Log-in Authenticated</title></head>
<body> <?php echo( $msg ); ?> </body> </html>
PLEASE HELP ME ON THIS GUYS!!!
Thank you!!