Jump to content

header() redirect up a directory


fivestringsurf

Recommended Posts

how do i redirect up a directory (into parent dirs) when using header() function and relative paths?

 

I have tried:

header("location:../../../msg.php");

 

Seems logical, like it would work(as in every other case), but it doesn't.  the ../../../  is ignored and php sends headers by just attaching msg.php to the current location.

 

how does one traverse back up the tree?

 

php5

Link to comment
https://forums.phpfreaks.com/topic/204608-header-redirect-up-a-directory/
Share on other sites

ok, thanks.

I guess since i've been using relative paths since the getgo (and they work if the file is in the current directory) i just assumed i could go the other direction too.

 

before i go write some long winded function to feel out where the files are, whether its local or live...do you have a simple way to redirect using relative paths through parent directorys?

 

probably not, but it's always worth asking:)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.