Jump to content

Include help


shirvo

Recommended Posts

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/38979-include-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.