Really slow include
| From: | anti-blank | Date: | Tue, 02 Apr 2002 21:37:46 +0000 |
| Subject: | Really slow include | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-91223@lists.php.net to get a copy of this message | ||
I have a header section for my website and I'd like to include it into each page. Since this
is where
I'm housing all of my navagation. Here is my problem though. I have the header tables sitting
in a page
header.htm. I'm calling it as so:
<?
require ("header.htm")
?>
This works fine as long as I stay in the main folder /htdocs where the header.htm file is.
The problem lies when I go any deeper. I tried replacing the link with:
<?
require ("/header.htm")
?>
Hoping that would put it back to the /htdocs folder as it works for my standard links. Instead
I get this:
Fatal error: Failed opening required '/header.htm'
(include_path='.:/usr/local/lib/php') in /www/foo/htdocs/foo/index_test.php on line 82
I've tried correcting it by including the full path:
<?
require ("http://www.foo.com/header.htm")
?>
This does work but it's so amazingly slow. Even on my cable connection it will take 20-30
seconds
to load this. I've switched back and forth between require and include with no change in
speed. Anyone
have a suggestion or an idea on why my load time is suffering so much?
I hope all of that was clear enough.
Thanks
anti-blank