Hi There.
I'm using an Include File at the Top and at the bottom of my PHP pages to autenthicate users.
I create a session and the User ID and Pass are global Variables.
The code is:
(Top One)
<?
// Search the user in the DB
$sql = "SELECT userid, pass FROM sacu_usuario WHERE userid='$id_glo'" ;
$query = mysql_query($sql);
$query_res = mysql_fetch_array($query);
$pw2 = $query_res['pass'];
// checks if the pass matches
if ($pw_glo==$pw2)
{
?>
Some other HTML and PHP code in here
And the bottom one is:
<?
}
else
{
?>
<font face="Verdana">
<P>
You can not view this page !!.
</P>
</font>
<?
}
?>
The problem is that I get 2 parse errors, in the top one, the line after the "{" and in the bottom one the second line, the one with "}"
Any clues ?
Can I leave IF statements open inside Includes ?
Plase, Help
Thanks
Jose