Jump to content

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:)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.