Jump to content

Pass


Bakes

Recommended Posts

Ok, my php page includes a file, which includes a second file. The second file provides the navigation bar of the first file.

 

Now, the navigation bar uses ' $_SERVER["PHP_SELF"];' to determine what page it's on, to determine what page, and as such what links to use. Unfortunately, this uses the included file rather than the main file. How would I get the current url of the main page, rather than the included page?

Link to comment
Share on other sites

You are apparently including files using their URL instead of the file system path. You should be including local files using their file system path (for several good reasons), in which case $_SERVER["PHP_SELF"] would be the correct value.

Link to comment
Share on other sites

This is correct. The reason I am doing this, is because they are hosted on different webservers, for reasons I don't want to go into.

 

I have replaced $_SERVER["PHP_SELF"] in the first included file with the true path, but I cannot do this for the banner because it changes for different pages.

So, how would I pass the var between the first included page and its banner?

Link to comment
Share on other sites

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.