A little background:
I have two servers. One of them is used for the creation of slideshows, and the second server is used for the display of the slideshows (once slideshows are created, they're pushed to the displaying server with rsync).
I'd like to implement a tracking system where we store the referrers in a text file with the slideshow on the display server. The person who created the show needs to be able to view that information back on the creation server.
The problem:
What's the best/fastest way to open the remote tracking files from the display server onto the create server? I'd like to pull the contents of the CSV file into an array. Currently, I have the following code:
$logfile = fopen("http://www.displayserver.com/slideshow/0001/log.txt", "rb");
$row = 0;
while (($data = fgetcsv($logfile, 1000, ",")) !== FALSE)
{
$num = count($data);
for ($c=0; $c < $num; $c++)
{
if($c == 0)
$log_array[$row]['ref'] = $data[$c];
if($c == 1)
$log_array[$row]['data'] = $data[$c];
}
$row++;
}
fclose($logfile);
But when trying to access the file remotely using fopen(), the page just sits there forever, doing nothing. I confirmed that allow_url_fopen is set to on. But I'm not even sure that fopen() is the best way to be accessing this data. Any suggestions?