How do I include specific files?
| From: | Roddie Grant | Date: | Mon, 02 Dec 2002 15:57:34 +0000 |
| Subject: | How do I include specific files? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-126724@lists.php.net to get a copy of this message | ||
I'm new to PHP, but from Lasso I'm used to the following sort of arrangement
(in pseudo-code)
Search for matching records
If number found=1
include "/folder/subfolder/file1"
If number found>1
include "/folder/subfolder/file2"
If number found=0
include "/anotherfolder/subfolder/file99"
where the included file contains the appropriate code for displaying a list,
a detailed record etc. In fact the whole page is made up almost entirely
from a succession of included files.
The paths all "hang" from the root as with HTML (for example <img
src="/images-folder-at-root-level/image.gif">).
In PHP the include_path stops this process in its tracks. I'm with an ISP so
I don't suppose I can control include_path (.:/usr/local/lib/php). Are there
any other options?
TIA
Roddie Grant
roddie@myword.co.uk