Hello folks,
my server does not support fopen i was getting errors when I deployed a site with external urls like so:
[php]include “http://dl.dropbox.com/u/21309836/weekdays.txt”;[/php]
so I tried replacing them with curl, and low and behold it worked, the external files data was visible.
But it was sooooooooooooooooooooooooooooooooooooooo slowwwww. How can I make this faster.
There were about 20 external links inside a switch, only 2 different urls. Maybe use only 2 curl instances, and
then put that into the switch 20 times, so we don’t open 20 curls?
[php]<?php
$url = “http://www.domain.com/”;
$data = “”;
$cp = curl_init();
curl_setopt($cp, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cp, CURLOPT_URL, $url);
curl_setopt($cp, CURLOPT_TIMEOUT, 60);
$data = curl_exec($cp);
curl_close($cp);
echo $data;
?>
[/php]