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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.