Jump to content

Recommended Posts

Hi.

 

I have a php file with database information(mysql IP address and pass) on my web server.

 

Is this file safe? is there any way of people downloading the source of this file (if they browse to it it does not echo anything, but is there a way of just downloading the actual php file)?

 

I know you can use encrypting tools such as ionCube and Zend, but is this needed? (also the loaders for these programs are not used on the hosted server and they are very expensive, so this is not really an option).

 

Thanks.

 

 

For additional safety, move your included files outside of the htdocs tree as well, and set your path accordingly... that way they can't be 'included' by a remote script which can then dump all the variables defined globally in your includes.

the hosting company have given me access to only one folder (because its SSL, they charge per SSL folder). I can create as many folders as I want in this one SSL folder, but anyone can access any of the folders I make.

 

It would not provide any extra security to put the includes in another folder in my situation, would it?

 

Would it be any good to put my includes in another folder, then make an index.php file that redirects with:

header('Location: http://www.home.com/');

 

Will this provide extra security? I think it will just make it more convenient for the users if they get lost.

You can't include a script from another site.

 

For additional safety, move your included files outside of the htdocs tree as well, and set your path accordingly... that way they can't be 'included' by a remote script which can then dump all the variables defined globally in your includes.

For additional safety, move your included files outside of the htdocs tree as well, and set your path accordingly... that way they can't be 'included' by a remote script which can then dump all the variables defined globally in your includes.

You can't include a script from another site.

I beg to differ.

The following is perfectly valid.

 

include 'http://www.example.com/file.php?foo=1&bar=2';

 

To quote the manual.

Remote file may be processed at the remote server (depending on the file extension and the fact if the remote server runs PHP or not) but it still has to produce a valid PHP script because it will be processed at the local server. If the file from the remote server should be processed there and outputted only, readfile() is much better function to use. Otherwise, special care should be taken to secure the remote script to produce a valid and desired code.

 

 

You can't include a script from another site.

 

For additional safety, move your included files outside of the htdocs tree as well, and set your path accordingly... that way they can't be 'included' by a remote script which can then dump all the variables defined globally in your includes.

 

Edit: Totally wasn't paying attention to what you were even talking about, my bad.

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.