Jump to content

Securing a php file with mysql username and password


dlcmpls

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.