Re: Line of code should work...but doesn't

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Very interesting...and extremely helpful.

It's amazing the major difference a little 'exit;' can make.

Many thanks for saving my sanity,

--JMR

Aaron Wolski wrote:

>if (strftime("%H") == "03")
>{
>	header( "Location: maintainence.php" );
>	exit;
>}
>
>Note the exit; line.
>
>Aaron
>
>-----Original Message-----
>From: J. Michael Roberts [mailto:jroberts@ha-ny.com] 
>Sent: July 24, 2003 10:09 AM
>To: php-db@lists.php.net
>Subject:  Line of code should work...but doesn't
>
>I've been going a little crazy here with a single line of code that 
>should work, but doesn't. It's probably has something to do with the 
>fact that I've been staring at pages of code for months on end.
>
>In order to make user that nobody is screwing with the database while 
>the daily backups and maintainence are running, I decided to make a 
>little thing that would keep people from logging in, etc. Here's the
>line:
>
>if (strftime("%H") == "03") { header( "Location: maintainence.php" ); }
>
>In theory, if it's any time between 03:00:00 and 03:59:59 the user 
>should be redirected to the page maintainence.php, but when testing it 
>passes over this line without a blip. Any ideas?
>
>Feeling fried,
>--JMR
>
>
>
>
>
>  
>

-- 
J-Michael Roberts
Highland Associates
228 East 45th Street
New York, NY  10017
212-681-0200 - phone
212-681-0201 - fax
JRoberts@ha-ny.com
http://www.HighlandAssociates.com




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux