[PHP-DB] Line of code should work...but doesn't

2003-07-24 Thread J. Michael Roberts
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




RE: [PHP-DB] Line of code should work...but doesn't

2003-07-24 Thread Aaron Wolski
if (strftime(%H) == 03)
{
header( Location: maintainence.php );
exit;
}

Note the exit; line.

Aaron

-Original Message-
From: J. Michael Roberts [mailto:[EMAIL PROTECTED] 
Sent: July 24, 2003 10:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] 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



RE: [PHP-DB] Line of code should work...but doesn't

2003-07-24 Thread jeffrey_n_Dyke

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   
 
  [EMAIL PROTECTED]To:   'J. Michael Roberts' 
[EMAIL PROTECTED], [EMAIL PROTECTED]
  z.com   cc: 
 
   Subject:  RE: [PHP-DB] 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:[EMAIL PROTECTED]
Sent: July 24, 2003 10:09 AM
  To: [EMAIL PROTECTED]
Subject: [PHP-DB] 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



Re: [PHP-DB] Line of code should work...but doesn't

2003-07-24 Thread J. Michael Roberts
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:[EMAIL PROTECTED] 
Sent: July 24, 2003 10:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] 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
[EMAIL PROTECTED]
http://www.HighlandAssociates.com





RE: [PHP-DB] Line of code should work...but doesn't

2003-07-24 Thread Hutchins, Richard
Aside from seeing that you've already solved this one, I'll also apologize
for obviously being wrong AND for the typo in the URI (should've been
www.yoursite.com/yourdir/maintenance.php).

Is it Friday yet? :)

 -Original Message-
 From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 24, 2003 10:34 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Line of code should work...but doesn't
 
 
 I'll admit right up front that this is an educated guess, but 
 I think you
 need to provide an absolute path for the location. 
 
 header(Location: http://yoursite/yourdir/maintenance.php;);
 
 Quoted from the online docs:
 Note: HTTP/1.1 requires an absolute URI as argument to 
 Location: including
 the scheme, hostname and absolute path, but some clients 
 accept relative
 URIs. You can usually use $_SERVER['HTTP_HOST'], 
 $_SERVER['PHP_SELF'] and
 dirname() to make an absolute URI from a relative one yourself.
 
 I use header() for redirects all the time as well and have 
 always made a
 habit of using a fully qualified URI just because the docs 
 said so. Never
 tried any other way so I've never had any problems with it.
 
 Hope this helps.
 
 Rich
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Thursday, July 24, 2003 10:29 AM
  To: Aaron Wolski
  Cc: 'J. Michael Roberts'; [EMAIL PROTECTED]
  Subject: RE: [PHP-DB] 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  

  
[EMAIL PROTECTED]To:   'J. 
  Michael Roberts' [EMAIL PROTECTED], 
  [EMAIL PROTECTED]
z.com   cc:

  
 Subject:  RE: 
  [PHP-DB] 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:[EMAIL PROTECTED]
  Sent: July 24, 2003 10:09 AM
To: [EMAIL PROTECTED]
  Subject: [PHP-DB] 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
 

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



RE: [PHP-DB] Line of code should work...but doesn't

2003-07-24 Thread Aaron Wolski
Hmm.. interesting.

I never use a full URI unless I am directing to a secure server and
things always work on my end.

Works either way I guess?

Aaron

-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED] 
Sent: July 24, 2003 10:34 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Line of code should work...but doesn't

I'll admit right up front that this is an educated guess, but I think
you
need to provide an absolute path for the location. 

header(Location: http://yoursite/yourdir/maintenance.php;);

Quoted from the online docs:
Note: HTTP/1.1 requires an absolute URI as argument to Location:
including
the scheme, hostname and absolute path, but some clients accept relative
URIs. You can usually use $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF']
and
dirname() to make an absolute URI from a relative one yourself.

I use header() for redirects all the time as well and have always made a
habit of using a fully qualified URI just because the docs said so.
Never
tried any other way so I've never had any problems with it.

Hope this helps.

Rich

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 24, 2003 10:29 AM
 To: Aaron Wolski
 Cc: 'J. Michael Roberts'; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] 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  
   
 
   [EMAIL PROTECTED]To:   'J. 
 Michael Roberts' [EMAIL PROTECTED], 
 [EMAIL PROTECTED]
   z.com   cc:
   
 
Subject:  RE: 
 [PHP-DB] 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:[EMAIL PROTECTED]
 Sent: July 24, 2003 10:09 AM
   To: [EMAIL PROTECTED]
 Subject: [PHP-DB] 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




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



Re: [PHP-DB] Line of code should work...but doesn't

2003-07-24 Thread CPT John W. Holmes
 I never use a full URI unless I am directing to a secure server and
 things always work on my end.
 
 Works either way I guess?

There's a big difference between works and the right way to do it...

---John Holmes...

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



Re: [PHP-DB] Line of code should work...but doesn't

2003-07-24 Thread John W. Holmes
[EMAIL PROTECTED] wrote:

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.
I say again: There is a big difference between works and the right 
way to do it. Think about it logically... if you are going to redirect 
to another page, there is absolutely no reason for another single line 
of PHP code to be run from the current script... so exit()!

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


Re: [PHP-DB] Line of code should work...but doesn't

2003-07-24 Thread jeffrey_n_Dyke

that why i love this list.

thanks


   
 
  John W. Holmes 
 
  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]
   
  rter.netcc:   Aaron Wolski [EMAIL 
PROTECTED], 'J. Michael Roberts'   
[EMAIL PROTECTED], [EMAIL PROTECTED] 
 
  07/24/2003 12:24 Subject:  Re: [PHP-DB] Line of code 
should work...but doesn't
  PM   
 
  Please respond to
 
  holmes072000 
 
   
 
   
 




[EMAIL PROTECTED] wrote:

 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.

I say again: There is a big difference between works and the right
way to do it. Think about it logically... if you are going to redirect
to another page, there is absolutely no reason for another single line
of PHP code to be run from the current script... so exit()!

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals ? www.phparch.com









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