Re: [PHP] How to make sure a redirect works

2004-03-17 Thread Benjamin
Henry Grech-Cini wrote: 1) Do not redirect if the page is visited as the result of a POST Why is that? I do it all the time and it seems to work fine. I have read through all the emails for this thread and didn't find anything mentioned. Am I doing something wrong? Benjamin -- PHP General

Re: [PHP] How to make sure a redirect works

2004-03-17 Thread John W. Holmes
Benjamin wrote: Henry Grech-Cini wrote: 1) Do not redirect if the page is visited as the result of a POST Why is that? I do it all the time and it seems to work fine. I have read through all the emails for this thread and didn't find anything mentioned. Am I doing something wrong? No,

Re: [PHP] How to make sure a redirect works

2004-03-11 Thread Christophe Chisogne
Vincent Jansen wrote: If you output a location header then I don't know what the browser will do with text sent after that. Hopefully nothing! Be carefull to exit() php code after header-location (and some text, see below): otherwise code following will be executed! It's a common error. I

Re: [PHP] How to make sure a redirect works

2004-03-11 Thread Henry Grech-Cini
Thankyou all, There's a lot of info here but I guess that I can summaries it as follows: 1) Do not redirect if the page is visited as the result of a POST 2) Keep text after header(Location: ...) to an absolute minimum. Namely a href=../a 3) Use absolute URLs not relative ones. 4) If you

[PHP] How to make sure a redirect works

2004-03-10 Thread Henry Grech-Cini
Hi All, I want to randomly select a desitniation page and use cookies to ensure that refreshes and return visits on the same machine always return to that desination (assuming the cookie is intact). Imagine that we have an array of URL's $url=array(1=dest1.html, dest2.html, dest3.html); // I'm

Re: [PHP] How to make sure a redirect works

2004-03-10 Thread trlists
On 10 Mar 2004 Henry Grech-Cini wrote: My question is are there problems with: ?php header(Location: .$url[$index]); ? As long as no other headers have been sent that should work fine. Location: is the standard method for redirection -- I'm not aware of any circumstances in which it

Re: [PHP] How to make sure a redirect works

2004-03-10 Thread Burhan Khalid
Henry Grech-Cini wrote: Hi All, I want to randomly select a desitniation page and use cookies to ensure that refreshes and return visits on the same machine always return to that desination (assuming the cookie is intact). Imagine that we have an array of URL's $url=array(1=dest1.html,

RE: [PHP] How to make sure a redirect works

2004-03-10 Thread Vincent Jansen
If you output a location header then I don't know what the browser will do with text sent after that. Hopefully nothing! I experienced some strange behaviour(=no redirect at all!!) with a script that send data after the location header. Best to do this header(Location: http://somesite.nl;);