Forum Moderators: coopster

Message Too Old, No Replies

Including an external page

         

turbohost

1:15 pm on May 27, 2006 (gmt 0)

10+ Year Member



Hi Guys,

Got an annoying problem. I want to include an external page via include but I get a 404 on the html page. There is no problem with the external to be included file because I can open it in my browser without a problem. When I place this external file on my website I can include it without a problem. Only when I try to include the file when it is located at another website I get a 404 on my webpage ... I don't have a clue what could be causing this ...

Turbo

eelixduppy

1:20 pm on May 27, 2006 (gmt 0)




Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote files via this function, even if allow_url_fopen is enabled.

I'm just assuming some things here. Let me know if I'm wrong about your PHP version or OS. For more information view include [us3.php.net]

turbohost

1:31 pm on May 27, 2006 (gmt 0)

10+ Year Member



Hi eelixduppy,

Thanks for your fast reply ... I'm running php 4.4.2 on RedHat Enterprise 4 ...

eelixduppy

2:06 pm on May 27, 2006 (gmt 0)



Well...my next action would be to check to see if allow_url_fopen [us3.php.net] is enabled. This has to be changed in the php.ini file.

turbohost

3:28 pm on May 27, 2006 (gmt 0)

10+ Year Member



allow orl fopen is 'on' ...

Can I only include php files?

eelixduppy

4:04 pm on May 27, 2006 (gmt 0)



It works with other types of text files also. Do you want to use the info in the file as code or just as text? Maybe you could use file_get_contents [us2.php.net]?

frozenpeas

11:29 pm on May 27, 2006 (gmt 0)

10+ Year Member



Is the include statement in a file on one server and the file to be included on another?

turbohost

2:36 pm on May 28, 2006 (gmt 0)

10+ Year Member



Fixed the problem ... the external file didn't give a http 200 header. This way, I could load it with my browser but not via include. Thanks for your help guys.

Turbo

eelixduppy

11:55 pm on May 28, 2006 (gmt 0)



No problem--although i didn't really help with the solution :) ...I'm glad you got it!