Re: Location ....

From: Date: Wed, 28 Dec 2005 14:24:35 +0000
Subject: Re: Location ....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-227933@lists.php.net to get a copy of this message
Christian Ista wrote: > Hello, > > Could you tell me a efficient solution for change page (new location) in > PHP? I tried this code : header("Location: mypage.php"); > note: HTTP/1.1 requires an absolute URI http://php.net/header > But in some case, I have error message "heade already send". Then I use a > javascript solution : window.location.href="mypage.php"; > > Is there a good solution in php ? > Check out 'headers_sent', you can choose how to redirect ('header' or JavaScript) depending on whether you have sent the headers or not. http://php.net/headers_sent HTH, cheers Silvio -- tradeOver | http://www.tradeover.net ...ready to become the King of the World?

« previous php.general (#227933) next »