When I goto the page I have the following script on, it's supposed to pop up a box that will allow me to download a zip file. Unfortunately, it's just displaying a bunch of gobbledy gook on the screen.
Ultimately, I want to be able to unzip the zip file, and email the contents to myself and partner once a day with a simple cron job. OR barring that, at least email the zip file.
Anybody willing to help a stupid PHP nub out?
Ultimately, I want to be able to unzip the zip file, and email the contents to myself and partner once a day with a simple cron job. OR barring that, at least email the zip file.
Anybody willing to help a stupid PHP nub out?
Code:
<?php
$start = mktime(0,0,0,date("m"),date("d")-1,date("Y"));
$url = "http://reporting.affiliateprogram.com/api.php?key=test&type=test&format=csv&start=".date("m-d-Y", $start)."&end=".date("m-d-Y", $start);
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
// grab URL and pass it to the browser
curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
?>