Jump to content

Recommended Posts

I believe that there is an easy way to solve my problem, maybe with a base URL... I'm new with php so I don't know a whole lot about this.

 

So I have my general page header located at www.domain.com/include/header.php that I call with

include("include/header.php");

 

Then I have the user header that shows when users login "www.domain.com/user/account.php", but this is the same as the general header and is located at: www.domain.com/include/userheader.php.

 

What I want to do is simply use the general header for users also, but I don't want to have to go through all the links and add, i.e. "../whateverpage.php" for users as I update the header often and this is very time consuming.

 

Is there any other way to do this?

Link to comment
https://forums.phpfreaks.com/topic/186195-establishing-base-url/
Share on other sites

If you want it all to be relative to the root of the webpage this add this to the html output in the header.php file:

 

<base href="http://www.domain.com/">

 

As that would set the base url to that for each page so the links etc are all relative to that path. If that is not what you wanted please let me know and try to describe better what you want.

 

 

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.