Re: hiding db password

From: Date: Thu, 12 Jun 2003 14:48:03 +0000
Subject: Re: hiding db password
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-28578@lists.php.net to get a copy of this message
> > <?php > > putenv("TWO_TASK=ORCL2"); > > putenv("ORACLE_HOME=/u01/home/oracle/product/9.2.0"); > > $conn = OCILogon("USER1","USER1PASS"); > > $query = OCIParse($conn,"select * from state"); > > OCIExecute($query); > > ?> > > > > Thank you > > Use an include file buried below your site root with > > $user=USER1; > $pass=USER1PASS; > > Then you should be able to do: > > Include"/path/to/pass.inc.php"; > <snip> > $conn = OCILogon("$user","$pass"); > > Which is more secure. Be careful when you say something is "more secure". From a file system perspective, this method is no different from putting the username/password in the regular PHP file. From a web server perspective, though, this is "safer" because if the web server ever broke and started serving PHP pages as plain text (been there, done that), then at least no one can get to your include file through your web server. ---John Holmes...

« previous php.db (#28578) next »