Start PHP IF statement in header and finish in footer?
Posted: Thu Feb 02, 2012 6:06 pm
Script URL: Intranet (unavailable outside DMZ)
Version of script: 2.1
Hosting company: -
URL of phpinfo.php: N/A
URL of session_test.php: N/A
What terms did you try when SEARCHING for a solution: header, footer, php
Write your message below:
I'm trying to write some PHP if/else to "hide" the helpdesk for two short intervals for a server cutover. I've got the following in header.inc.php (variables are times set earlier in script):
Rest of the code / includes / etc.
AND... in the footer.inc.php file I've the closing tag:
I've got the start/end of the php if/else above/below the main container table. I've turned debug on and it complains about end of script on line 86 in header.inc.php (and displays a blank page). HUH? I've many many many PHP scripts with headers/footers that have if statements starting in the header and finish in the footer. Why does this not work with the hesk header/footer php files?
NOTE: I have tested the if/else statements in standalone file prior to adding them here - the problem is not with the statements.
Anyone got any ideas?
Version of script: 2.1
Hosting company: -
URL of phpinfo.php: N/A
URL of session_test.php: N/A
What terms did you try when SEARCHING for a solution: header, footer, php
Write your message below:
I'm trying to write some PHP if/else to "hide" the helpdesk for two short intervals for a server cutover. I've got the following in header.inc.php (variables are times set earlier in script):
Code: Select all
if (($today > strtotime("-5 minute", $startotg)) && ($today < strtotime("+5 minute", $startotg))) {
echo 'text message to display to user - moving to backup';
} elseif (($today > strtotime("-5 minute", $endotg)) && ($today < strtotime("+5 minute", $endotg))) {
echo 'text message to display to user - return to production';
} else {
AND... in the footer.inc.php file I've the closing tag:
Code: Select all
} // end display messages if between set times.
NOTE: I have tested the if/else statements in standalone file prior to adding them here - the problem is not with the statements.
Anyone got any ideas?