shirvo Posted February 18, 2007 Share Posted February 18, 2007 i have i config.ph page that l use so i can put all the database login information and the title of the website so it can be changed very simply. Now i have a dbconnect.php page that has to connection script in it The below code is config.php <?php /****** Installation ******/ $sitetitle = 'AusFamily.com' ; // Website title /****** Database ******/ $cfgServerHost = 'localhost'; // MySQL hostname $cfgServerUser = 'shirvo'; // MySQL user $cfgServerPassword = '137879'; // MySQL password $cfgDbDatabase = 'shirvo_ausfamily'; // MySQL database name containing phpSecurePages table $cfgDbTable = 'user'; // Where all the information is stored ?> The below code is dbconnect.php <? include('config.php') $conn = mysql_connect($cfgServerHost, $cfgServerUser, $cfgServerPassword); if (!$conn) die('Error connecting to server!'); mysql_select_db($cfgDbDatabase , $conn) or die('Error selecting database'); ?> Ok now when l use me website is comes up with this; Parse error: syntax error, unexpected T_VARIABLE in /home/shirvo/public_html/dbconnect.php on line 6 line 6 is this; $conn = mysql_connect($cfgServerHost, $cfgServerUser, $cfgServerPassword); so i am thinking that the $cfgServerHost, $cfgServerUser, $cfgServerPassword are not getting through Anyone please help ASAP Quote Link to comment Share on other sites More sharing options...
phat_hip_prog Posted February 18, 2007 Share Posted February 18, 2007 It all looks ok, I was considering whether you needed to declare the vars as global before you used them, but there not in functions. So, i'm thinking that your password needs to be considered as a string not a number ??? Quote Link to comment Share on other sites More sharing options...
Imtehbegginer Posted February 18, 2007 Share Posted February 18, 2007 Try switching all of the $cfg to $cfg['NAMEHERE'] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.