For 'include' you do not use the URL. Instead use the physical server path. 
Something like

include $_SERVER['DOCUMENT_ROOT'] . "/connect.php";

P-



--- Kishore Balla <[EMAIL PROTECTED]> wrote:

> Hi all,
> 
> I'm facing a problem with including the database config file..
> 
> I kept database variables in a config file like this..
> 
> connect.php
> 
> <?php
> 
> $dbhost='something';
> $dbuser='something';
> $dbpass='something';
> $dbname='something';
> ?>
> 
> then in my home.php file I've included that file ( both connect.php and
> home.php are in same folder );
> 
> <?php
> 
> include 'connect.php';
> 
> $db=mysql_connect($dbhost,$dbuser,$dbpass);
> mysql_select_db($dbname,$db);
> 
> //some actions
> 
> ?>
> 
> The above thing worked fine until I moved the config file to root
> directoryso that It will be available to all scripts..
> 
> the changes I've made to the script.. home.php
> 
> <?php
> 
> include 'http://domain.com/connect.php';
> 
> $db=mysql_connect($dbhost,$dbuser,$dbpass);
> mysql_select_db($dbname,$db);
> 
> //some actions
> 
> ?>
> 
> the above code this throwing errors.. what could the problem...
> 
> thanx in advance...
> 
> --
> KISHORE
> 
> 
> [Non-text portions of this message have been removed]
> 
> 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to