Jump to content

Absolute Paths


sagnik

Recommended Posts

What happens everytime I upload my website to Tommy server is I've to change the included scripts path in PHP which I've to find.

Link to comment
Share on other sites

Use relative paths and this won't happen. If you have a file in public_html and want to include something in a folder called include, instead of saying:

include('/home/username/public_html/include/myinclude.php');

Use:

include('include/myinclude.php');
Link to comment
Share on other sites

Actually, I've a file called "header.php" in "E:/home/wn/public_html/mobile/global" directory which I has to include in every pages/scripts. So when I upload my website, I has to change the path to "/home/sgn/public_html/wn/mobile/global/header.php". That's what I don't like.

Link to comment
Share on other sites

Where is the actual site files that will include the header.php be going, in the mobile folder?

 

If you use the same directory structure on the local test server, and relative paths throughout, you won't have to edit much of anything except database info. I have a massive amount of interconnected code and applications on my account, and there are very few places where absolute paths were required.

Link to comment
Share on other sites

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.   Paste as plain text instead

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