Re: Redirecting to a URL

From: Date: Tue, 08 Jan 2002 15:23:19 +0000
Subject: Re: Redirecting to a URL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-79790@lists.php.net to get a copy of this message
Hy Robert MacCombe wrote:
Hi, how do I redirect to a different URL, e.g. as a result of an IF condition being true. I'm basically looking for a PHP version of the ASP - Response.Redirect("/otherpage.htm")
use the header function to send a location: header to the browser: $redirect_url="http://www.nowhere.net/"; if( $foobar=="" ){ header( "Location: ".$redirect_url ); } henning

« previous php.general (#79790) next »