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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.