Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Passing variables in PHP


BitBanger - 2:40 pm on Jan 18, 2004 (gmt 0)


WestCoGuy:
Now I'm trying to figure out how to hide the userid and password info required to do SQL queries... sure don't want them in the PHP script! Must be more than one way to skin a cat here...

The normal way of doing that is to include() the php code that contains the connection information. For added security, place that php code in a directory that is not accessable from the web. This also means that all the connection information is centrally located, making changes a simple matter of changing one file.

Also, unless the server screws up, any php file is not directly available from the web. It should always be parsed by the server, so the username and password are hidden anyway.


Thread source:: http://www.webmasterworld.com/php/2586.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com