Paul Posted July 10, 2012 Share Posted July 10, 2012 Hi all, I'm about to make a site live for the first time that includes a config file and a mysqli_connect script. In Larry's examples of a config file he defines an absolute path to the mysqli login script. In local testing it's "C/blah/blah/etc." In live it will be http:// something. However Larry recommends that the mysqli script is kept outside of the main web directory. I've managed to do that on the hosting companies file structure but how do I write an absolute path to it. If it was in the same directory as say the home page it would be http://www.mywebsite.co.uk/mysqli_connect.php. But how do I write it so it's one directory 'up'? Cheers Paul Link to comment Share on other sites More sharing options...
abigail Posted July 10, 2012 Share Posted July 10, 2012 Here is how I do mine. I had to ask my webhost and they said that /home/advice10 would refer to my directory above the web files. define ('MYSQL', '/home/advice10/mysqli_dbc.inc.php'); Link to comment Share on other sites More sharing options...
Paul Posted July 10, 2012 Author Share Posted July 10, 2012 abigail, Great. I shall raise a ticket with my hosting company. Thanks for your help. Paul Link to comment Share on other sites More sharing options...
abigail Posted July 10, 2012 Share Posted July 10, 2012 One thing I just noticed, and this might save you some time. When I go to cpanel, then filemanager, the menu at left shows my top level directory is /home/advice10. Assuming, you have linux webhosting, probably yours shows you that information. Link to comment Share on other sites More sharing options...
Recommended Posts