Re: Problem with Remote PHP includes




Thanks for the reply. I was hoping that "allow_url_fopen" being set to on
would mean it ought to work.

I'm afraid this is the first time I've tried to use PHP, and I can't see
where to put the URL into the example you gave me:

http://php.net/function.fsockopen#47845

Can you help?

Thank you,

Nicola


"Kim André Akerø" <kimandre@xxxxxxxxxxxxxxxxxx> wrote in message
news:3psk24FbqrdpU1@xxxxxxxxxxxxxxxxx
> Hobgoblin Music wrote:
>
>> My website is hosted by Demon. The PHP version is 4.3.5, and
>> allow_url_fopen is set to on.
>>
>> This command:
>>
>> <?php include("http://www.mysite.com/file.htm";); ?>
>>
>> Fails every time, even though the same command, on the same page,
>> works fine on a different server (which uses version 4.3.11).
>>
>> (I am using a .php extension on the page in question)
>>
>> I really need the same page to call up the same data on both sites,
>> and the address has to be remote, so I can't use Server Side Includes.
>>
>> I've tried different URLS and file types (including .php files), but
>> the Demon site will not run this command, although it copes fine with
>> this:
>>
>> <?php include("../file.htm"); ?>
>>
>> Is there something obvious I have missed?
>>
>> (I can't make the path relative on one site and remote on the other,
>> as I need to use exactly the same file on both sites).
>
> It appears that the "URL fopen wrappers" has been disabled by your
> webhost.
> http://php.net/function.include
> http://php.net/ref.filesystem#ini.allow-url-fopen
>
> However, there are ways to work around this. Seeing as you're only
> including a basic HTML file, and don't need any PHP functions from the
> remote site, this example from the PHP manual might be right for you:
> http://php.net/function.fsockopen#47845
>
> --
> Kim André Akerø
> - kimandre@xxxxxxxxxxxxxxxxxx
> (remove NOSPAM to contact me directly)


.



Relevant Pages

  • PHP-CLI and the "less" command (kubuntu)
    ... I have a CLI application that produces lots of output to the terminal, so I like to send the output along to the "less" command. ... But I've now tried in different terminal programs, and reading output other than output from PHP, and the ONLY time it happens is when I pipe output from PHP to "less". ... It may work well the first time, but when repeating the same command a second time, the "weird" behavior starts. ... It could very well be some kind of problem with "less", but since I can only reproduce the problem with output from PHP CLI, I thought it's worth asking here. ...
    (php.general)
  • Help With if/else in PHP/MySQL
    ... Copyright 1997-2003 The PHP Group ... it should display the input fields the ... first time you access it. ...
    (comp.lang.php)
  • Re: [PHP] accessing variables within objects
    ... I got the link the first time and read the page. ... You will want to look at using the Overloading feature of PHP5. ...
    (php.general)
  • Re: Problem with Remote PHP includes
    ... > My website is hosted by Demon. ... > Fails every time, even though the same command, on the same page, ... > (I am using a .php extension on the page in question) ... > and the address has to be remote, so I can't use Server Side Includes. ...
    (alt.php)
  • Re: odd GET s
    ... > from 4 different IPs. ... suffixed files and then sending some duff information to see if PHP ... I can't see how youget the Zend Optimizer logo from the first link, ... I think first time around, ...
    (comp.lang.php)