Forum Moderators: coopster

Message Too Old, No Replies

i want to fetch contents from a given url

i want to fetch contents from a given url

         

vivek avasthi

12:06 pm on Jun 13, 2006 (gmt 0)

10+ Year Member



hi friends ,

i just want to fetch contents from a given url like www.yahoo.com/index.php

how can i do this..?

trillianjedi

12:09 pm on Jun 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Vivek,

You could just call WGET from php...

TJ

Creactiv

12:46 pm on Jun 13, 2006 (gmt 0)

10+ Year Member



or the fopen function in PHP.

eelixduppy

12:50 pm on Jun 13, 2006 (gmt 0)



Also, file_get_contents [us2.php.net] should work too ;)

jatar_k

6:38 am on Jun 15, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



or a socket for that matter

ogletree

6:49 am on Jun 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have to use Curl because pair has a lot of weird security.

<?php

$URL = "www.domain.com";

$ch=curl_init($URL);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$source_text=curl_exec($ch);
curl_close($ch);

print $source_text;
?>

The print is just to see what you have fetched for testing purposes.