Re: [PHP] redirecting without headers or meta tags or javascript
if you're trying to redirect with something like header, then you need to do that redirection before any output is sent to the browser...(note, ANY output, likes SPACES) look at www.php.net/header if you're interested... jack Justin French wrote: hi, i'm in the body of a html page, and I'd like to redirect to a new URL in an if() statement. I *could* re-write the whole page so that the test is in the head, and use meta tags to refresh, but i'd rather not... the code will be heaps cleaner without it. thanks Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] redirecting without headers or meta tags or javascript
On Tuesday 03 April 2001 08:22, you wrote: hi, i'm in the body of a html page, and I'd like to redirect to a new URL in an if() statement. I *could* re-write the whole page so that the test is in the head, and use meta tags to refresh, but i'd rather not... the code will be heaps cleaner without it. Three solutions: (1) Open a telepatic connection to the users browser and appeal to its sense of duty to go to the new page (2) Rewrite the thing (3) Use output buffering -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Never doubt that a small group of thoughtful, committed people can change the world... Indeed, it's the only thing that ever has." - Margaret Mead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] redirecting without headers or meta tags or javascript
Christian Reiniger wrote: (1) Open a telepatic connection to the users browser and appeal to its sense of duty to go to the new page that sounds about as reliable as javascript :P (2) Rewrite the thing looks like that'll be the case (3) Use output buffering huh? appreciate mroe on this... Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] redirecting without headers or meta tags or javascript
On 3 Apr 2001 06:26:47 -0700, Justin French [EMAIL PROTECTED] wrote: (3) Use output buffering huh? appreciate mroe on this... put ob_start() at the top of your page and ob_end_flush() at the bottom. PHP will store all of the output instead of sending it to the browser. If you put a header("Location: foo"); exit; somewhere, that output will never be set. (Take a look at the ob_* functions in the manual when you have a spare moment - there's some pretty cool things you can do with them, particularly if you use the gz handler to compress pages on the fly.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]