parse error

the error is…

Parse error: parse error, unexpected $ in /home/content/j/a/g/jagger0913glob/html/login.php on line 65

65 is the last line…


<?php error_reporting(E_ALL); mysql_connect("XX.6.XXX.1X4","globalfoos","JXXXXXXXX"); mysql_select_db("globalfoos") or die(mysql_error()); //Checks if there is a login cookie if(isset($_COOKIE['Globalfoos'])) //if there is, it logs you in and directes you to the members page { $username = $_COOKIE['Globalfoos']; $pass = $_COOKIE['Globalfoos1']; $check = $cQuery="SELECT * FROM users WHERE user='".$username."' AND pass='".$pass."'"; while($info = mysql_fetch_array( $check )) { if ($pass != $info['password']) { } else { header("Location: forums.php"); } } } //if the login form is submitted if (isset($_POST['submit'])) { // if form has been submitted // makes sure they filled it in if(!$_POST['username'] | !$_POST['pass']) { die('You did not fill in a required field.'); } // checks it against the database if (!get_magic_quotes_gpc()) { $_POST['txtEmail'] = addslashes($_POST['txtEmail']); } $check = mysql_query("SELECT * FROM users WHERE user = '".$_POST['username']."'")or die(mysql_error()); $info = mysql_fetch_assoc($check); //Gives error if user dosen't exist if (!$info) { die('That user does not exist in our database.>'); } while($info = mysql_fetch_array( $check )) { $_POST['pass'] = stripslashes($_POST['pass']); $info['password'] = stripslashes($info['password']); //gives error if the password is wrong if ($_POST['pass'] != $info['password']) { die('Incorrect password, please try again.'); } else { // if login is ok then we add a cookie $_POST['username'] = stripslashes($_POST['username']); $hour = time() + 3600; setcookie(Globalfoos, $_POST['username'], $hour); setcookie(Globalfoos1, $_POST['pass'], $hour); //then redirect them to the members area include(redirect.php) [/php]

u have a some errors in ur code.

please use error_reporting(E_ALL); at the begining of ur script.

“unexpected $” means “unexpected end” ($ = end).
the syntax error is caused by 3 missing ‘}’.

i DID use error_reporting(E_ALL);


You are missing a semi-colon after the last include.

Sponsor our Newsletter | Privacy Policy | Terms of Service