Jump to content

Recommended Posts

Posted

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.

Posted

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');
Posted

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.

Posted

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.

Posted

In "/", "/orders","/profile","/accounts", etc.

Posted

In "/",

include("wn/mobile/global/header.php");

"/orders",

include("../wn/mobile/global/header.php");

"/profile",

include("../wn/mobile/global/header.php");

"/accounts", etc.

include("../wn/mobile/global/header.php");

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...