[thelist] alternative connections to different servers

Andrew Maynes andrew at humanbehaviour.co.uk
Sun Feb 2 04:58:01 CST 2003


Hi All
I just want to run this one by you all before I spend anythime that could be
wasted further down the line.  I want to run the same script on my local setup
as well as on my server.  Only I am making changes on my local code that then
requires an upload and refresh to the working server.  The difference between
the scripts is also the setting to connect to the Db and paths. I was thinking
of putting in a if else senario to stop having to change the settings everytime
I download upload... is this a good plan or is there an alternative I should
consider??  Here is this code to if anyone fancies giving me a working example
of what would work :)

Cheers Andrew

/* Replace these variables with information for connecting to your database
server */
$DBHost="localhost";
$DBUser="root";
$DBPass="xxx";
$DBName="dbname";
function DBInfo() {
global $DBHost,$DBUser,$DBPass,$DBName;
}

/* Replace these variables with the absolute and relative paths to your scripts
*/
$WebRoot="/local";
$Relative="/local";
$WebHost="http://localhost";
function Root() {
global $WebRoot,$Relative,$WebHost;
}




More information about the thelist mailing list