Hello, I have moved to a new host that does not allow the usage of Fopen, so I am trying to use curl, but I am stuck, I have figured out part of how to get this to work (i think).
This is the original Script
[code] function YMTRipper($URL)
{
$this->URL = $URL;
$this->initURL();
$f = fopen($URL, "r");
if($f)
while($pre = fread($f, 1000))
$this->source = $this->source.$pre;
else
{
echo 'Unable to open '.$URL.'.';
return false;
}
}[/code]
This is my modified one
[code] function YMTRipper($URL)
{
$c = curl_init($URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$f = curl_exec($c);
curl_close($c);
if($f)
// Here is where I get confused…
// I can’t use Fread as im not using fopen and this is disabled on my //server, However I have to use something in the loop
while($pre = fread($f, 1000))
$this->source = $this->source.$pre; //????
else
{
echo 'Unable to open '.$URL.'.';
return false;
}
}[/code]
So, In the Fopen script it does a looping return of
$this->source = $this->source.$pre;
Where $pre = fread($f, 1000)
How would I do a simular read with Curl??