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
https://forums.phpfreaks.com/topic/61281-how-to-protect-php-files/
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.

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.