include() syntax

From: Date: Fri, 22 Sep 2000 14:08:02 +0000
Subject: include() syntax
Groups: php.general 
Request: Send a blank email to php-general+get-17294@lists.php.net to get a copy of this message
Hi all, I'm trying to work through include function syntax. I am working in a directory called "news" and trying to include a file in a directory next to it called "inc". Both directories are under "/dca" of the server's root. When I try to include "../inc/links.php" it works just fine, but I'd prefer to specify a pathname from the server root than a relative pathname. That way, I could use the same call from any level of the directory structure. I guess the problem is that php treats that as a URL, not a local pathname. When I try to include the file from the web server root path, "/dca/inc/links.php", I get a parse error "Warning: failed opening". When I try this: include("http://" . $SERVER_NAME . "/dca/inc/linklist.php"); The file gets included and executes, but no variables that were previously set are used, so the links.php does not produce the desired results. I get similar results from the require function. I fiddled with fopen() a little, but concluded that I should ask for help at that point. Any ideas or suggestions please? Thanks, David ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ David Askov dca@riverside.com Riverside Technology, inc. 2290 E. Prospect Rd., Suite 1 Fort Collins, CO 80521 http://www.riverside.com P: (970)484-7573 F: (970)484-7593 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

« previous php.general (#17294) next »