View Full Version : Including a file from an external server?
FleaBag
12-06-2001, 11:03 AM
I wish to include files, eg headers and footers, in my vB styles from sites on other servers. Anyone have any idea how to go about achieving this via PHP? Thanks.
amykhar
12-06-2001, 11:39 AM
It's actually rather easy IF you don't need to pass parameters back and forth.
you can do the include statement using a url. :)
include ("http://www.easilyaddictive.com/header.php");
for example. However, when you do this, if header.php has a variable in it such as $username, you won't be able to read it. This has given me more grief on my sites; however, I believe that it is essential for security.
Amy
FleaBag
12-06-2001, 12:27 PM
Hey Amy, thanks for the reply. For some bizarre reason using includes within the vBulletin styles doesn't seem to work. At the top it says soemthing about do not directly echo out, does that have anything to do with this? Thanks again.
amykhar
12-06-2001, 12:43 PM
Yes. That has a lot to do with it. Because of the location of your post, I assumed we were speaking general php and not vbulletin specific.
You will need to use the ob_start stuff to make it work.
Amy
FleaBag
12-06-2001, 01:04 PM
Is there a URL you can refer me to for more help with this? Because I'm also unable to include my hosts banners at present too. Thanks, and sorry for being a pest!
amykhar
12-06-2001, 01:06 PM
search vbulletin.com for information on the phpinclude template. That's the best info I can give you.
Amy
FleaBag
12-06-2001, 01:50 PM
Thanks Amy, I'll have a look around. :)
boatdesign
07-10-2002, 04:07 AM
search vbulletin.com for information on the phpinclude template. That's the best info I can give you.
If anyone could give me a pointer on this as well I would appreciate it. I asked over at vbulletin.com and they said they could not help with including an external php file and to come over to vbulletin.org and ask
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.