Welcome Guest, Not a member yet? Register   Sign In
taking down the system
#1

I have a cron job that I will run every Sat night. 

One of the first things it does is:

$_SERVER['MAINT']=1;  

This creates a $_Server variable and sets it to one. At the end of the cron job I use:

$_SERVER['MAINT']=0;
echo('done with cron_job');
exit(0);


This correctly sets the MAINT to zero and exits.

But when a user brings up my main application, in the index() I have:

if ($_SERVER['MAINT']==1) {
   show_error("The Substantiator is down for weekly maintanance. ",500,"System down");
   exit(0);
}


This is not working. When I stop with the debugger on the line above and look for $_Server['MAINT']==1, it doesn't exist. This causes a real error instead of the fake one I am trying to create. 

I thought the $_SERVER variable is global on the Apache. What am I doing wrong?

Rich
proof that an old dog can learn new tricks
Reply


Messages In This Thread
taking down the system - by richb201 - 08-25-2018, 07:32 PM
RE: taking down the system - by ragingTorch - 08-25-2018, 08:14 PM
RE: taking down the system - by richb201 - 08-26-2018, 06:06 AM
RE: taking down the system - by ragingTorch - 08-26-2018, 07:02 AM
RE: taking down the system - by richb201 - 08-26-2018, 08:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB