sagnik Posted February 20, 2018 Posted February 20, 2018 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.
wolstech Posted February 20, 2018 Posted February 20, 2018 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');
sagnik Posted February 20, 2018 Author Posted February 20, 2018 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.
wolstech Posted February 20, 2018 Posted February 20, 2018 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.
sagnik Posted February 21, 2018 Author Posted February 21, 2018 In "/", "/orders","/profile","/accounts", etc.
Krydos Posted February 21, 2018 Posted February 21, 2018 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");
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now