PHP Include question


#1

Hi,

I have a free app that access a mysql db and lets users make changes. In the header file I have added:
<?php include('rotator.php'); ?>

This works perfectly (It’s a simple random image function from A List Apart). The problem is I have three seperate installations of the app, looking at different databases and I would like to consolidate the files.

When I change the location of the .php file (So all three installations point to the same file (making it easy to update etc)). E.G.:
<?php include('http://www.planetphillip.com/siteimages/headers/rotator.php'); ?>

I get this mesage:

Warning: main(): URL file-access is disabled in the server configuration in (URL of header file)
Followed by a few other lines saying something about a suitable wrapper.

I would have included the whole text but wasn’t sure whether the username and machine name should be kept private!

So, if you got this far and understood my problem, any ideas?

TIA

Phillip
http://www.planetphillip.com/
Commentary and Analysis of Sci-Fi Single Player First Person Shooters


#2

http://wiki.dreamhost.com/index.php/Allow_url_fopen

You can’t use http type addresses when including or opening files.
If they are on the same server then just use relative address like ‘…/includefile.php’.

From the wiki
include($_SERVER[‘DOCUMENT_ROOT’]."/includes/example_include.php");


#3

Great works perfectly, thank you.

Phillip
http://www.planetphillip.com/
Commentary and Analysis of Sci-Fi Single Player First Person Shooters