Jump to content

Recommended Posts

I have DB password and other important information stored in settings.php. I will put settings.php outside public directory.

 

But what I am not sure about is that I use to require_once settings.php into every page (index.php, users.php, profile.php, login.php, ...). Is that safe? I was thinking that if somebody came into any single main file, he will find out where I store setttings. If this file wouldn't be included in this way, than this won't be happen in any file.

 

So for example file users.php starts like this:

 

require_once(thePathName/settings.php');

checkLogIn(1);

require_once $_SERVER['DOCUMENT_ROOT'].'/languages/lang_'.$language.'.php';

 

...

if somebody came into any single main file

 

If someone has direct access to one of your files, they have access to all of them and it does not matter where you put your included files.

 

Is that safe?

 

What makes you think php including files it needs is not safe? There are 10's of millions of php based web sites including files now.

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.