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

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

 



Its funny...

I try not to use them either.. but a lot of times I just have to or I
get the results that Michael was experiencing.

Perhaps it comes down to a matter of how you structure your if()
statements.

Aaron

-----Original Message-----
From: jeffrey_n_Dyke@Keane.com [mailto:jeffrey_n_Dyke@Keane.com] 
Sent: July 24, 2003 10:29 AM
To: Aaron Wolski
Cc: 'J. Michael Roberts'; php-db@lists.php.net
Subject: RE:  Line of code should work...but doesn't


this may work, but i hesitate, i've _never_ had to use exit to get my
code
to excecute a redirect.  and i'm heavily reliant on this function.

did aarons fix work for you?  i think you're problem lies elsewhere.  as
i've just mocked the same thing on my server, but using 10 instead of
03...i'm on EST and its excecutes perfectly.

don't mean to cause waves...just curious.
Jeff




 

                      "Aaron Wolski"

                      <aaronjw@martekbi        To:       "'J. Michael
Roberts'" <jroberts@ha-ny.com>, <php-db@lists.php.net>            
                      z.com>                   cc:

                                               Subject:  RE: 
Line of code should work...but doesn't                            
                      07/24/2003 10:12

                      AM

 

 





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





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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

  Powered by Linux