# PHP Golf Problems

**URL:** <https://forum.kirupa.com/t/php-golf-problems/85611>\
**Category:** programming\
**Created:** [April 6, 2005, 1:53am UTC](https://forum.kirupa.com/t/php-golf-problems/85611 "2005-04-06T01:53:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coold8](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@coold8](https://forum.kirupa.com/u/coold8)\
**Post date:** [April 6, 2005, 1:53am UTC](https://forum.kirupa.com/t/php-golf-problems/85611/1 "2005-04-06T01:53:16Z")

</div>

I am having some problems with some PHP.

Here are the two files that aren’t clicking when I try to login. (The site is [www.manalapangolf.com/golf](http://www.manalapangolf.com/golf) Login: Guest Password: Guest)

The problem is:

header()  
**Parse error** : parse error, unexpected T\_IF, expecting ‘)’ in **/home/manalapan/domains/manalapangolf.com/public\_html/golf/auth.inc.php** on line **51**

**First Document: (dbasecon.inc.php)**

header(\<?  
\<A href="mailto:$db=@mysql\_connect(“localhost”\>$db=@mysql\_connect(“localhost”, “manalapan\_score”, “score”) or header(“Location:login.php?xc=3112”);  
mysql\_select\_db(“manalapan\_score”,$db);  
?\>)

**Second Document: (auth.inc.php)**

\<?  
session\_unset(); //unsets all the variables

if (!$db) {

header(“Location: login.php?xc=3112”);  
exit();  
}

$password=$HTTP\_POST\_VARS[‘password’];  
$login=$HTTP\_POST\_VARS[‘login’];

//authentication sql to the dbase  
$authsql= “Select \*  
From users\_tour a1 where  
(password=’$password’)  
AND (userid=’$login’)”;  
$authquery=@mysql\_query($authsql);  
$authrow=@mysql\_fetch\_array($authquery);  
$authexist=@mysql\_numrows($authquery);  
$login\_id=$authrow[userid];

header (if ($authexist) {  
extract($authrow);

session\_start(); //start the session

$authdata=array(“login\_id”=\>$login);  
session\_register(‘authdata’);

if (!$PHPSESSID) { //register the sessions if there’s no sessionid  
session\_register(‘login\_id’);

} elseif (!$login\_id) { //if any session variable undeclared, register them!  
session\_register(‘login\_id’);

}  
//assigns session variables to the form variables!

$login\_id=$login;

} else {

header(“Location: login.php?xc=24601”);  
exit();

} //endif authexist

?\>

Thanks for your help!
