header() in ie and mozilla

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
User avatar
Guy
Forum Commoner
Posts: 53
Joined: Sun Jan 12, 2003 3:34 am

header() in ie and mozilla

Post by Guy »

I'm using

Code: Select all

<?php
header("Location: ../default.php"); 
?>
in login.php page which is in an include directory above the root directory,
to redirect after a login check.
the default page(which calls login.php) is in the root directory, and the login check page is
in a directory above.
in IE6 it works ok, but in MOZILLA it send me back to the parent of the root directory.
any ideas?
Thanks
Guy
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

../default.php applies to the current url of the document as seen from the browser, regardless of the position of the script that created the header.
Having an url http://the.test.ed/script.php ../default.php is quite silly. IE accepting it (in some way) is not a fault of mozilla ;)
Post Reply