Need help with cURL

software development

#1

i need to convert this into curl:

}
say(‘Download in progress’);

say(“Downloading games.sql”);
download(“http://yourarcade.info/util/games.sql","games.sql”);

$xmlParser = new XMLParser(file_get_contents(‘http://yourarcade.info/util/games.xml’));
$xmlParser->Parse();

foreach ($xmlParser->document->game as $game)
{
$totalGames++;
$thumbfile = urlencode(trim($game->thumb[0]->tagData));
$gamefile = urlencode(trim($game->remote_url[0]->tagData));
say("Downloading: [ $totalGames ]: “.$gamefile.” & ".$thumbfile);
download(“http://yourarcade.info/games/images/”.$thumbfile,’…/games/images/’.$thumbfile);
download(“http://yourarcade.info/games/files/”.$gamefile,’…/games/files/’.$gamefile);
}
say(“fin… running bigdump.php”);
say(’’);
?>

whenever I open up the php file it says there is an error:
URL file-access is disabled in the server configuration.

Thanks i f you can convert the script into cURL.

Cheers.


#2

if yourarcade.info is your site (which it doesn’t look like based on your script), you should just access the files using the linux path instead of over http.

here’s how to get the contents of a file from a different site into a variable using curl:

<? $curl = curl_init('http://example.com/getfile.xml'); curl_setopt($curl, CURLOPT_HEADER, 0); // ignore any headers ob_start(); // use output buffering so the contents don't get sent directly to the browser curl_exec($curl); // get the file curl_close($curl); $xml = ob_get_contents(); // save the contents of the file into $xml ob_end_clean(); // turn output buffering back off ?>
track7 - my dream-hosted site