Helpful Information
 
 
Category: vB3 Programming Discussions
Including a file from an external server?

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.

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

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.

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

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!

search vbulletin.com for information on the phpinclude template. That's the best info I can give you.

Amy

Thanks Amy, I'll have a look around. :)

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










privacy (GDPR)