Hiya, I've got this php on my side:
Which delivers the zip file fine but it doesn't actually write the .log.txt file with the same name that should contain the number of downloads. Does the php script need to be given certain permissions or something?
Thanks for any help...
<?php // base url location of files - MUST USE TRAILING SLASH!! $base_url = "http://www.greyaliengames.com/boo/"; // list of filenames - DO *NOT* PREFIX WITH SLASH!! $files = array("test1.zip", "test2.zip"); // all the boring processing stuff below... $id = $_GET['id']; if ($id >= 0 && $id < sizeof($files) && is_numeric($id)) { $log_filename = $files[$id] . ".log"; $redirect_url = $base_url . $files[$id]; $handle = @fopen($log_filename, "r"); if ($handle) { $curr_count = fgets($handle); fclose($handle); } if (!is_numeric($curr_count)) $curr_count = 1; else $curr_count++; $handle = @fopen($log_filename, "w"); if ($handle) { fwrite($handle, $curr_count); fclose($handle); } header('Location: ' . $redirect_url); print('<html><body><a href="' . $redirect_url . '">Click here if you are not transfered automatically.</a></body></html>'); } else { echo '<html><body>Error: Invalid file specified</body></html>'; exit(); } ?>
Which delivers the zip file fine but it doesn't actually write the .log.txt file with the same name that should contain the number of downloads. Does the php script need to be given certain permissions or something?
Thanks for any help...