Orginally when I designed my site, I put the db access file, conn.php, in the 
webarea - where all files reside. After reading a recent thread, I realize 
that this may not be too secure. Therefore, I would like to shove conn.php 
one level above the webarea. However, I don't feel like re-writng 300+ files 
with the new db access info, so I thought a simple re-direct page might do 
the trick.


I've tried three methods: 

the header approach  
header("location: ../conn-up.php");

an absolute header:
header("location: /vhome/conn-up.php");

and an include approach:
include("../conn-up.php"); 



/* Db file access (conn.php) -- all pages presently refer or call this file */

<?php session_start(); ob_start(); ?>
<?php
/* $db = pg_connect("dbname=big user=me password=pwd");   old string */
header("location: /vhome/site/conn-up.php"); // tried 3 approaches above
?>


/* New db access (conn-up.php) - now located one level above webpages  */

<?php session_start(); ob_start(); ?>
<?php
$db = pg_connect("dbname=big user=me password=pwd");
?>


All three approaches will not allow db access. I'm stumped. Is it possible to 
do this, and will this protect the db password any better than if it stays in 
the webarea?

Any help, guidance, or ideas most welcome. 

Tia,
Andre

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to