Hi Guys, im pretty new at PHP.
I have this website done in php by the developer and im trying to do the same website..,
I have downloaded all the contents and database but having trouble on working on my local system. Basically I know how to insert data from forms but having trouble accessing the database.
Here are the codes to access the database:
$path_check = '';
if ( file_exists(dirname(FILE).'/LIVE') ){
$path_check = 'live';
}elseif ( file_exists(dirname(FILE).'/STAGE') ){
$path_check = 'stage';
}
switch ( $path_check ){
case 'live':
define('SERVER_MODE', 'LIVE' );
define('HOST' , 'http://some.url/' );
define('DB_HOST','');
define('DB_USER','');
define('DB_PASS','');
define('DB_NAME','' );
define('MAIL_HOST', '');
define('MAIL_USER', '');
define('MAIL_PASS', '');
define('MAIL_PORT', 25 );
define('MAIL_AUTH', true);
define("MAIN_SITE_URL", 'http://some.url/');
$campaign_startdate = '2009-05-01';
$campaign_enddate = '2009-06-15';
break;
case 'stage':
define('SERVER_MODE', 'STAGE' );
define('HOST' , '' );
define('DB_HOST','');
define('DB_USER','');
define('DB_PASS','');
define('DB_NAME','' );
define('MAIL_HOST', '');
define('MAIL_USER', '');
define('MAIL_PASS', '');
define('MAIL_PORT', 25 );
define('MAIL_AUTH', true);
define("MAIN_SITE_URL", '');
$campaign_startdate = '2009-05-01';
$campaign_enddate = '2009-06-15';
break;
default:
error_reporting(E_ALL);
define('SERVER_MODE', 'LIVE' );
define('DB_HOST','mysql55-45.wc1.dfw1.stabletransit.com');
define('DB_USER','username');
define('DB_PASS','password');
define('DB_NAME','some database' );
define('HOST' , '' );
define('MAIL_HOST', '');
define('MAIL_USER', ');
define('MAIL_PASS', '');
define('MAIL_PORT', );
define('MAIL_AUTH', true);
define("MAIN_SITE_URL", 'http://www.someurl.com/');
for the 'default' I have tried to change SERVER MODE = STAGE, DB_HOST = localhost, DB_USER=root, DB_PASS= root, DB_NAME = thedatabasename.
but I got no luck, someone please let me know the right code for this, as I have manage to work on it online but not on my local system.
Any feedback will be much appreciated
Cheers