dlcmpls Posted October 16, 2007 Share Posted October 16, 2007 Hello everyone. I have a small php/mysql app. For that app I have a file called appglobals.php. In that file is a bunch of stuff, including variables used to define the user name and password for the mysql database. By including this appglobals.php file in all files that need access to the db, I only have to maintain the db info in 1 place. For security reasons I like to place my appglobals.php file one leve above the site root. So for example, if the site root is "httpdocs" I like to put my appglobals.php one level above that directory. Normally this works fine, but my new web host doesn't allow files to be placed in the same location as "httpdocs." I could move my file into the root, but that's less secure. Given that I can't put my file one level above the root, I'm wondering if anyone has suggestions as to what to do next. I have to put my file in the httpdocs directory, so what's the best way to secure the file there yet still make it available to my app? Thanks in advance. dlc Quote Link to comment https://forums.phpfreaks.com/topic/73543-securing-a-php-file-with-mysql-username-and-password/ Share on other sites More sharing options...
marcus Posted October 16, 2007 Share Posted October 16, 2007 You could probably put it in a folder above your root directory. include "/home/name/somefolder/file.php"; Quote Link to comment https://forums.phpfreaks.com/topic/73543-securing-a-php-file-with-mysql-username-and-password/#findComment-371052 Share on other sites More sharing options...
dlcmpls Posted October 16, 2007 Author Share Posted October 16, 2007 Well, that's the problem. I can't create new folders above the root and I can't place files in the same location as the root. Quote Link to comment https://forums.phpfreaks.com/topic/73543-securing-a-php-file-with-mysql-username-and-password/#findComment-371055 Share on other sites More sharing options...
marcus Posted October 16, 2007 Share Posted October 16, 2007 Don't create, just upload to the folder above root. Quote Link to comment https://forums.phpfreaks.com/topic/73543-securing-a-php-file-with-mysql-username-and-password/#findComment-371056 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.