Revolution Posted August 28, 2008 Share Posted August 28, 2008 We currently use this header code to pull data from WHMCS to our pages outside of WHMCS (everypage from within the public_html directory): <?php include("clientarea/dbconnect.php"); include("clientarea/includes/functions.php"); $link = mysql_connect($db_host,$db_username,$db_password); mysql_select_db($db_name); ?> But if we use the same code and put it a directory within public_html such as public_html/hosting/index.php we produce errors and it cannot locate the database. <?php include("http://www.domainname.com/clientarea/dbconnect.php"); include("http://www.domainname.com/clientarea/includes/functions.php"); $link = mysql_connect($db_host,$db_username,$db_password); mysql_select_db($db_name); ?> Any ideas would help right now. 0 Quote Link to comment Share on other sites More sharing options...
GnomeyNewt Posted August 28, 2008 Share Posted August 28, 2008 You need to use your paths, not urls to include the files, so it should look more like: <?php include("/clientarea/dbconnect.php"); include("/clientarea/includes/functions.php"); $link = mysql_connect($db_host,$db_username,$db_password); mysql_select_db($db_name); ?> OR <?php include("/home/username/public_html/clientarea/dbconnect.php"); include("/home/username/public_html/includes/functions.php"); $link = mysql_connect($db_host,$db_username,$db_password); mysql_select_db($db_name); ?> 0 Quote Link to comment Share on other sites More sharing options...
Revolution Posted August 29, 2008 Author Share Posted August 29, 2008 Sparky, Thank you for all your help, dedication, and quick responses. Your code worked like a charm and you were very knowledgeable to all my fixes. Thank you. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted August 29, 2008 Share Posted August 29, 2008 Thank you... Glad I could help 0 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.