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. Quote
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'); Quote
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. Quote
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. Quote
sagnik Posted February 21, 2018 Author Posted February 21, 2018 In "/", "/orders","/profile","/accounts", etc. Quote
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"); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.