PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
FredEH
Forum Newbie
Posts: 18 Joined: Fri May 09, 2003 8:39 am
Post
by FredEH » Fri Jun 06, 2003 2:00 am
Hi,
I have been having a problem with my website loading VERY slow. By trial and error, I was able to find that any time I use code like this:
Code: Select all
<?php
$include = 'http://www.whatever.com/header.php';
$include_output = implode('', file($include));
?>
My site bogs way down. Could this be a problem with my host? Or is this a common problem when using this type of code
Thanks in advance
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Jun 06, 2003 2:12 am
depends on the size of the document, the time it takes to contact the other site and the transfer bandwidth.
FredEH
Forum Newbie
Posts: 18 Joined: Fri May 09, 2003 8:39 am
Post
by FredEH » Fri Jun 06, 2003 2:15 am
What if it is the same site and its just a small header file?
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Jun 06, 2003 2:15 am
then why do you read it via http?
FredEH
Forum Newbie
Posts: 18 Joined: Fri May 09, 2003 8:39 am
Post
by FredEH » Fri Jun 06, 2003 2:18 am
Well... because i'm using it for my phpbb and the header file is not in a relative path.
Gleeb
Forum Commoner
Posts: 87 Joined: Tue May 13, 2003 7:01 am
Location: UK
Contact:
Post
by Gleeb » Fri Jun 06, 2003 8:56 am
All paths on the same physical server are relative. don't forget about ..