Jump to content

VirtualOdin

Members
  • Posts

    10
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

VirtualOdin's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So I moved the downloads and protected the directory, so that was OK security wise. And, after much mucking about with cPanel, I ended up editing httpd.conf directly and got Apache to generate the right logs. However the log returns - one with a correct download and one a cancelled one - are identical: [30/Nov/2011:12:08:04 +0000] "GET /test.php?do=download HTTP/1.1" 200 203753 "<my site>" "<Browser signature>" 204292 + [30/Nov/2011:12:08:04 +0000] "GET /test.php?do=download HTTP/1.1" 200 203753 "<my site>" "<Browser signature>" 204292 + So I am back to square one. To restate the problem, I am trying to log when a user has completed a download, not when they started one and aborted it for whatever reason. Your ideas would be most welcome. I'm right royally stuck!
  2. Catch 22! I am storing the files in question above the public access directory for security reasons so all I see in the logs is the PHP script that calls the download. So either I relax my security or (advice please) could I persuade apache to log accesses to the directory in which the files are stored?
  3. Thanks but I cannot risk the user being cut off. He/she will have paid! I saw here http://arstechnica.com/civis/viewtopic.php?f=20&t=355634 that searching the server logs might give a result. I can capture the user identity at the start (IP address, browser type etc) if there was a way of PHP accessing the logs. Still open to suggestions therefore, please...
  4. So, I have a script that works downloading a file - excerpt below: header("Pragma: public"); header("Expires: 0"); header('Content-type: "application/octet-stream"'); header("Cache-Control: private",false); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); $f = "Content-Disposition: attachment; filename=\"".$myfile['downloadname'].".".$myfile['ext']."\""; header($f); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($file)); ob_clean(); flush(); readfile("$file"); exit(); I record elsewhere in a mysql database when the script is started. In addition, I'd like to be able to record whether the download completes (successfully or otherwise). As it is, the script can run and the user press cancel and it looks like a download but isn't. Is this possible? If so, how? Your help, as ever, gratefully received.
  5. So trial and error has produced this for two tables SELECT * FROM `person` a LEFT JOIN (SELECT `person_id`, MAX(`range`.`date`) AS maxRangeDate FROM `range` GROUP BY `person_id`) b ON (`a`.`id` = `b`.`person_id`) LEFT JOIN (SELECT `person_id`, MAX(`assignment`.`date`) AS maxAssignmentDate FROM `assignment` GROUP BY `person_id`) d ON (`a`.`id` = `d`.`person_id`) JOIN `range` c ON ( `b`.`person_id` = `c`.`person_id` AND `b`.`maxRangeDate` = `c`.`date`) JOIN `assignment` e ON ( `b`.`person_id` = `e`.`person_id` AND `d`.`maxAssignmentDate` = `e`.`date` ) WHERE `a`.`departure` = '0000-00-00' But it is taking quite a time on no data to speak of.
  6. That's great for one additional table. What I should have thought through is that I have a four tables like 'event' on each of which I need to do the same. I'd appreciate any advice on how to do it with more than one, so for each person I pull out the latest value from the other tables organised like event, ie with a date and some date related to the person (max dates will vary of course). I can't quite see what to replicate to end up with all the latest data from the 4 tables.
  7. Yes, sorry should have said, there is a DATE field in the 'event' table
  8. I have two tables, 'person' with all the static data and 'event' with multiple records for each bit of dynamic data associated with rows in 'person' through 'person_id'. So I can extract all the event data with something like SELECT * FROM `person` LEFT JOIN `event` ON ( `person`.`id` = `event`.`person_id`) WHERE ... And from that result I can work out in PHP which is the latest event, which for this purpose is all I need. But I feel sure it should be possible to do all that inside the query and pull out only the latest 'event' data and the person material. Is it possible? As always, thanks in inticipation...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.