Jump to content

Recommended Posts

I dunno if this is a php code thing, but since i use a config.php file for all my database connection details, is it possible to prevent someone from downloading this file if they find out the location of it?

like if they find a link to it and right click > save as

Link to comment
https://forums.phpfreaks.com/topic/187335-preventing-file-dl/
Share on other sites

What I was talking about:

 

/home/www/site/folder/index.php

Is the index.php file of your site. You would store config.php in:

 

/home/www/site/config.php

That way they cannot just browse to  http://www.yoursite.com/config.php  as it would not exist. But you can still include the file by going up one directory with ../ and then it is safe incase somehow your server decides to stop parsing php etc.

 

 

Link to comment
https://forums.phpfreaks.com/topic/187335-preventing-file-dl/#findComment-989354
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.