OT: cURL (was Re: [Javascript] Content Retrieval)

Roger Roelofs rer at datacompusa.com
Wed Aug 11 05:55:08 CDT 2004


Tim,

On Aug 11, 2004, at 6:05 AM, Matt Barton wrote:

> Can't provide you with an example I'm afraid, but I can direct you to 
> cURL,
> and let you know what it does.  You might be lucky - it might already 
> be
> installed on the machine thats hosting your site.
>


If you use php, curl is not necessary.

<?php

$var = file_get_contents("http://www.mydomain.com/index.html"); // puts 
whole file in a string var

// if your php installation is older you can

$aVar = file("http://www.mydomain.com/index.html");  //puts file into 
an array of lines
$var = implode("\n", $aVar);                         //concatenates 
array into string var

// extracting the required text is left as an exercise for the reader...

?>




More information about the Javascript mailing list