SharkBait Posted December 17, 2007 Share Posted December 17, 2007 Ok I am having some weird thinking issues and trying to make a website more... universal throughout so hopefully I can explain it well enough to hopefully get some help with it. /index.php /mysql_connect.php /funcs.php /includes/header.html /includes/footer.html /products/index.php Ok take that as an example. I want to be able to create a 'global' variable that i can set in /includes/header.html that will allow me to have /products/index.php require /includes/header.html and /includes/footer.html properly. /includes/header.html also includes /mysql_connect.php and /funcs.php Or are /mysql_connect.php and /funcs.php in the wrong place for this to work properly? when i add require('/includes/header.html"); and require("/includes/footer.html"); in the /products/index.php file. I get errors that it can not find the /mysql_connect.php file nor the /funcs.php file. Does this make sense?? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 17, 2007 Share Posted December 17, 2007 A leading slash on a file system path, like in your examples, refers to the root of the current hard drive. I recommend using absolute file system paths that will work independent of the current working directory and independent of the include_path setting. require($_SERVER['DOCUMENT_ROOT'] . "/includes/header.html"); Quote Link to comment Share on other sites More sharing options...
SharkBait Posted December 17, 2007 Author Share Posted December 17, 2007 Ah that's it. Thanks! Helps keeping things uniformed and easier to update! Quote Link to comment Share on other sites More sharing options...
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.