Without going into too much detail right out of the barn, I'd like to explain an error I'm getting (for what appears to be no logical reason) in the hopes someone can help a brutha out.
I have an intro page that includes both a header and a footer in the form of:
<?
include("./inc/header.php");
?>
page contents
<?
include("./inc/footer.php");
?>
The header file contains require statements and some mysql code that I use to ensure that if a $visitor exists in the db, they can see the intro page.. if not, they get redirected to the login page.
require("/path/to/config.php");
require("/path/to/html.php");
if ($visitor){
mysql code here ending with the following statement:
$row = mysql_fetch_array($sql_result);
?>
Then html header content such as title, styles, etc.
The bottom of my intro page (the footer.php) has the redirect statement in the form of:
<? } else {
header( "Location: https://www.mydomain.com/login.php");
exit; // don't output anything else
}
?>
The problem I'm seeing is a parse error expecting a } on line 154 of the header page. If you put all three pages back together without the include statements, the thing works fine. Why would breaking them apart into 3 separate pieces cause an unexpected $end error?