|
-
Jan 24th, 2001, 08:06 AM
#1
What is the PHP equivalent to ASP's Response.Redirect?
I.E. How do I do:
Code:
<% Response.Redirect "http://www.mralston.co.uk/" %>
in PHP?
I tried doing it with headers:
Code:
<? header("HTTP/1.0 302 Object Moved\nLocation http://www.mralston.co.uk/"); ?>
but I just got an internal server error.
So what's the proper way to do it?
-
Jan 24th, 2001, 01:05 PM
#2
Black Cat
Try just
and see if that works.
Josh
-
Jan 24th, 2001, 06:35 PM
#3
Cheers...
I actually figured it out earlier this evening.
MSDN said:
HTTP/1.0 302 Object Moved
Location URL
so that's exactly what I used...then it occured to me that the HTTP version & mode (error, not found, ok etc) header would have already been added to the stack and also that it might need a colon because I've successfully sent Content-Type headers before and always used a colon.
Stupid MSDN. Dunno why having two HTTP headers in the stack caused an error though...(according to that now infamous MSDN) the last header of that kind overrides any previously sent... unless it was the lack of a colon that was the problem. Either way MSDN was wrong! 
Anyway, done now...redirect page works...am happy. Cheers!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|