Jump to content

preventing file dl?


RaythMistwalker

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

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.