Re: redirect to another page in PHP???

From: Date: Fri, 20 Jul 2001 06:32:11 +0000
Subject: Re: redirect to another page in PHP???
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-58847@lists.php.net to get a copy of this message
On 20 Jul 01, at 0:03, Doug wrote: > Ok maybe I'm just retarded and can't find it but I'm looking for a way to > do a redirect in a php page to another page, similar to asp's > "response.redirect" function. Is there one in php??? No doubt there's plenty of options... here's what I'm using: I have the following function in one of my standard function libraries: function redirect($url, $timeout) { echo "<meta http-equiv=\"Refresh\" content=\"$timeout; url=$url\">"; } $url being where you want to redirect to and $timeout being the delay before the redirection takes place (set it to 0 for immediate redirect). Then when I want to do a redirection on a page I just use this: redirect("http://www.some.place.else/", "5"); I've found this particularly useful in situations where you want to let people know you're doing a redirection somewhere or want to display some sort of message before the redirection takes place. No doubt there's other solutions, there usually is. CYA, Dave ----------------------------------------------------------------------- Outback Queensland Internet - Longreach, Outback Queensland - Australia http://www.outbackqld.net.au mailto:dfreeman@outbackqld.net.au -----------------------------------------------------------------------

« previous php.general (#58847) next »