Jack,

If your script which has to redirect the user spits out _ANY_ output (i.e.
carrige return, space, HTML of any sort) then it will be unable to send
header info to the browser. If the script is not supposed to send any data
to the browser other than a redirect, you have some whitespace or something
similar before a <?php tag or an echo tag or something that spits out output
above your header line.

You could try a <meta redirect...something> tag (I forget the exact syntax)
if you want the browser to refresh the page at a later time (i.e. check back
every 5 seconds for updates).

If you use the header trick, remember to place an exit; after that line. I
had a weird phantom problem where the script would send the browser
elsewhere, but continue with the rest of the script.

-Dash

-----Original Message-----
From: Jack Kelly Dobson [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, November 26, 2002 2:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Redirect browser to another URL?


Hello,

Anyone know how to have a script re-direct the browser to a URL cleanly?

I've tried using header("location:" . $url); but I'm running into a problem
with a server error saying header data was already sent from "some line in
the script that was running" as if the new url is being opened after a
header has already been sent.

All I want to do is have the script stop it's execution and open another
page.

Any ideas?

j-



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to