PHP Sessions and Redirects... (was Re: [PHP-WIN] Redirect browser to another URL?)
| From: | Luis Ferro | Date: | Wed, 27 Nov 2002 11:29:02 +0000 |
| Subject: | PHP Sessions and Redirects... (was Re: [PHP-WIN] Redirect browser to another URL?) | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-17161@lists.php.net to get a copy of this message | ||
If there are sessions involved, this second method is prefered, because it will give PHP a chance to change the server sessions.
Sessions can be VERY tricky, specially if one expects the changes of a var to reflect immediatly in the session... they won't... and it is prefered that you issue a client-side refresh to force the update. In that respect, ASP session management is much more straightforward... (even is ASP is way inferior in almost everything else...)...
Cheers...
Luis Ferro
Cam Dunstan wrote:
Jack, here is another quick and dirty function to stick in your library, yet another way to redirect from anywhere in your script function redirect($url){ echo "<script>window.location.replace(\"".$url."\")</script>"; } usage: blah blah redirect("any_url"); exit;--- [This E-mail scanned for viruses by Declude Virus]-----Original Message----- From: Jack Kelly Dobson [mailto:jdobson@tcgcorp.net] Sent: Tuesday, November 26, 2002 2:43 PM To: php-windows@lists.php.net Subject: [PHP-WIN] Redirect browser to another URL? Hello, Anyone know how to have a script re-direct the browser to a URL cleanly?