PDA

View Full Version : Where do you save the following information?


duniyadnd
05-23-2003, 03:32 AM
Not sure if this is a php/mysql question... more of a security issue..

When people use PHP and MySQL on their servers, they have to frequently call in the four constants for the database

1. username
2. databasename
3. password
4. hostname

Where do you people usually store this information? Inside the public_html folder? or above that? If above that, how do you call it?

Duniyadnd

pardicity3
05-23-2003, 07:06 AM
I usually just store it in a file named secretstuff.php or the like. This way if a devious person tries to view the file all they get is a blank page cause the php is processed before the page gets to them. Afaik, there is no way to pull the staff that I have saved in this file unless someone gets into my ftp somehow and downloads it themselves :).

firepages
05-23-2003, 10:29 AM
if your host allows it you would be well to put that config file above your web root.

you can include as per usual ..
include_once('../config.php');//as called from your doc root
or
include_once('/home/user/config.php');

etc , not all hosts give you access above your document root though in which case you can .... get another host ;) , else as pardicity3 mentions as long as config.php echo's nothing to screen its relatively safe.

Fatman
05-24-2003, 12:54 PM
yeah i always have a db.inc file which has all the stuff in - no data is outputted and the only way to get it woul be to physicail download the file :)