note 52674 rejected from function.include by nlopess

From: Date: Mon, 09 May 2005 18:12:30 +0000
Subject: note 52674 rejected from function.include by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-89170@lists.php.net to get a copy of this message
Note Submitter: wusyk at nortel dot com ---- A question about include and paths. I'm new to PHP and converting from ASP and IIS to AMP. I'm trying to use the include as such: <?php include ('/topdir/includes/site_settings.inc'); ?> When I do this i get the following error: Warning: main(/topdir/includes/site_settings.inc) [function.main]: failed to open stream: No such file or directory in D:\Personal\CYM\CYMnet\ca\about.php on line 6 When I specify the following it works: <?php include ($_SERVER['DOCUMENT_ROOT'].'/topdir/includes/site_settings.inc'); ?> Is there any way I can avoid using the $SERVER before my path like I can do with IIS and ASP in the form: <!--#INCLUDE VIRTUAL="/CA/includes/site_settings.inc"--> Thanks for your help?

« previous php.notes (#89170) next »