RE: [PHP] Security/Web tree/db connect and select

From: Date: Tue, 01 Jun 2004 15:11:52 +0000
Subject: RE: [PHP] Security/Web tree/db connect and select
Groups: php.general 
Request: Send a blank email to php-general+get-187348@lists.php.net to get a copy of this message
John W. Holmes <mailto:holmes072000@charter.net> on Friday, May 28, 2004 11:25 PM said: > You're right. Option 2 offers more security in that no one will ever > be able to reach the file directly with a web browser. You don't need > to use file() or file_get_contents(), though... A simple > include('../includes/db.inc'); wil work (where ../ takes you outside > of the webroot and into an includes/ directory for the db.inc file). > Or use an absolute path include('/home/user/includes/db.inc'); where > /home/user/www/ is your webroot (for example). how about just calling 'db.php' so that when someone does request it via a web browser it will be parsed and end up not sending any data to the client? chris.

« previous php.general (#187348) next »