# PHP cant get contents of another page



## Boylett (Dec 23, 2006)

Well I have this: http://boylett.hopto.org:81/teamspeak/index.php
It is a php script and it generates its contents by openning sockets and asking stuff on servers.

Well it loads fine. But I need to get its html contents and put them on another website

I have tried:
include("http://boylett.hopto.org:81/teamspeak/index.php");
echo file_get_contents("http://boylett.hopto.org:81/teamspeak/index.php");

But whenever I try, the webpage never loads. It just sits there.

How can I fix this


----------



## aewarnick (Sep 3, 2002)

I'm just guessing but the way you're trying to do this should not work for obvious security reasons. Let's say I was to try:
include("http://google.com");
I wouldn't expect it to work.

Try, if you can, not using an fully qualified path.


----------



## brendandonhu (Jul 8, 2002)

include() works fine for this, it just sounds like your server has allow_url_fopen disabled. You can try using cURL instead.


----------



## aewarnick (Sep 3, 2002)

This would work?
include("http://google.com");


----------



## brendandonhu (Jul 8, 2002)

Yes (unless allow_url_include is turned off in your PHP configuration.)


----------

