leela Posted September 13, 2007 Share Posted September 13, 2007 Hai, Thanks for ur help to my previous question ! I need the count for total downloads ..This is my code : $file="personal_photos/".$arr[0]['path']; if(file_exists($file)) { $file_type = filetype($file); header("Content-Type:".$file_type); header("Content-Disposition: attachment; filename=".basename($file)); header( "Content-Description: File Transfer"); $download = @readfile($file); if($download) { $query = "UPDATE tbl_images SET hits = hits + 1 WHERE id='".$id_img."' "; $result = mysql_query($query) or die(mysql_error()); header("Location:image_download.php"); exit(0); } }//if(file_exists($file)) Whats my problem is...as soon as i click on download button , the count is increased.. But i need the count increased only after open / save is clicked and not on cancel.. i tried using javascript also,but no use.. Plz someone help me Thanks, Leela Link to comment https://forums.phpfreaks.com/topic/69150-count-of-total-downloadsnot-getting-correctly/ Share on other sites More sharing options...
Psycho Posted September 13, 2007 Share Posted September 13, 2007 There's no way to do that. Neither PHP nor JavaScript have the ability to determine the usr's action once control is turned over to the OS. Link to comment https://forums.phpfreaks.com/topic/69150-count-of-total-downloadsnot-getting-correctly/#findComment-347584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.