How to include URL's content not a file?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
juhaphu
Forum Newbie
Posts: 3
Joined: Mon Sep 21, 2009 9:26 am

How to include URL's content not a file?

Post by juhaphu »

http://www.redtie.ro/products/demo/weat ... s/FRXX0076

The URL above is not a file and it shows the weather in Paris. Is it possible to include the URL's content to my php-page? How? And I don't mean that page's code, it's a dynamic webpage. Thanks.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: How to include URL's content not a file?

Post by jackpf »

You can use cURL.

But are you allowed to be doing this :/

Have you asked the owners of the website?
juhaphu
Forum Newbie
Posts: 3
Joined: Mon Sep 21, 2009 9:26 am

Re: How to include URL's content not a file?

Post by juhaphu »

I tried cURL but got only blank page. I'm not going to use that url... it's only an example.
juhaphu
Forum Newbie
Posts: 3
Joined: Mon Sep 21, 2009 9:26 am

Re: How to include URL's content not a file?

Post by juhaphu »

The problem solved:

$Content = implode('',file("http://www.geekpedia.com/index.php"));
echo $Content;
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: How to include URL's content not a file?

Post by jackpf »

Oh right, I would have thought you had url_fopen turned off...but I guess your hosts allowed it.

Btw, you don't need the first arg for implode().
Post Reply