Re: help out a noob w/ include & switch?

From: Date: Tue, 20 Sep 2005 23:54:33 +0000
Subject: Re: help out a noob w/ include & switch?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-222829@lists.php.net to get a copy of this message
[...]
Try the following: 1) include() will only trigger a warning if the requested file is not within the include path. Thus, to make sure the file is found, you should use "require()" which triggers a fatal error and prevends the script from being executed if the given filename as the parameter cannot be found. This will give you probably a hint if there's something wrong with the include-path 2) Another suggestion would be to prepend "./" to the file you try to include: instead of include("file.php"); you should use include("./file.php"); "./" indicates that php should lookup the requested file in the directory the php-file resists in which called the include()-function.

« previous php.general (#222829) next »