Page redirection with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
reuben
Forum Newbie
Posts: 1
Joined: Fri Jan 28, 2005 12:18 pm

Page redirection with PHP

Post by reuben »

Hi I am using:

Code: Select all

header("Location: mypage.php");
to redirect to mypage.php. My problem is that when redirecting, the Interet Explorer address bar remains with the old URL, not with the page I just have been redirected. How can I solve this? I really need to solve this problem because if the user hits F5 to reload the page, the 'old' page is loaded and not the page that I was redirected to.

Thanks,

Reuben
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sounds like you're using frames, as using the header redirect changes the url shown normally..

try placing the full url as the destination.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Code: Select all

header('Location: http://example.com/mypage.php');
try the above instead. Because i don't think all browsers support that all very well, since it's rather pretty new. http://www.ietf.org/rfc/rfc3986.txt
Post Reply