# parse error

**URL:** <https://www.phphelp.com/t/parse-error/10414>\
**Category:** Beginners - Learning PHP\
**Created:** [October 3, 2007, 12:17am UTC](https://www.phphelp.com/t/parse-error/10414 "2007-10-03T00:17:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kovk](https://www.phphelp.com/letter_avatar_proxy/v4/letter/k/c0e974/32.png) [@Kovk](https://www.phphelp.com/u/Kovk)\
**Post date:** [October 3, 2007, 12:17am UTC](https://www.phphelp.com/t/parse-error/10414/1 "2007-10-03T00:17:22Z")

</div>

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]

\<?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]

---

<div class="post-metadata">

**Author:** ![Q1712](https://www.phphelp.com/letter_avatar_proxy/v4/letter/q/a183cd/32.png) [@Q1712](https://www.phphelp.com/u/Q1712)\
**Post date:** [October 3, 2007, 12:35am UTC](https://www.phphelp.com/t/parse-error/10414/2 "2007-10-03T00:35:56Z")

</div>

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 ‘}’.

---

<div class="post-metadata">

**Author:** ![Kovk](https://www.phphelp.com/letter_avatar_proxy/v4/letter/k/c0e974/32.png) [@Kovk](https://www.phphelp.com/u/Kovk)\
**Post date:** [October 3, 2007, 1:39am UTC](https://www.phphelp.com/t/parse-error/10414/3 "2007-10-03T01:39:57Z")

</div>

i DID use error\_reporting(E\_ALL);

---

<div class="post-metadata">

**Author:** ![Q1712](https://www.phphelp.com/letter_avatar_proxy/v4/letter/q/a183cd/32.png) [@Q1712](https://www.phphelp.com/u/Q1712)\
**Post date:** [October 3, 2007, 11:06am UTC](https://www.phphelp.com/t/parse-error/10414/4 "2007-10-03T11:06:53Z")

</div>

> [@""Kovk""](#):
>
> i DID use error\_reporting(E\_ALL);

sry

---

<div class="post-metadata">

**Author:** ![Ragster00](https://www.phphelp.com/letter_avatar_proxy/v4/letter/r/a9adbd/32.png) [@Ragster00](https://www.phphelp.com/u/Ragster00)\
**Post date:** [October 3, 2007, 2:36pm UTC](https://www.phphelp.com/t/parse-error/10414/5 "2007-10-03T14:36:21Z")

</div>

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