Jump to content

How to protect PHP files?


colinexl

Recommended Posts

Hi All,

 

I have a php script that contains the login information to my SQL database. I was wondering if there is a secure way of protecting access to that php page? I will want the server to be able to read it, but just not any users who stumbles upon that page. Right now if I try to view that page in a browser, all I get is a blank page. However, I don't feel that this is a very solid way of protecting a php page.

 

Thanks,

Colin

Link to comment
Share on other sites

No one can view the true PHP source code of .php files from a web browser so no need to worry. The only time when someone can see the true source code of your php script is either the server is not setup properly or someone manages to get hold of your FTP username/password.

 

No source code is ever returned - only the output (html/text). If php source code was always returned every site that was coded in php would be so easy to hack.

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.