shahhitesh10 0 Report post Posted July 22, 2006 I am offering some download stuffs to the visitors of my site..I have seen on some sites that they host download files on a box with 2 columns, the left one showing the filename and the right column showing the number of times the file has been downloaded..I want to know how to do these.. Is there any javascript available for this..if yes then please provide the link for the script. Share this post Link to post Share on other sites
electron 0 Report post Posted July 23, 2006 I dont think it is posible using Java Script.You can do it with a server side Language like PHP(I know that).You could either use a DB(DataBase) or a FS(FileSystem).But not JS. Share this post Link to post Share on other sites
shahhitesh10 0 Report post Posted July 23, 2006 Thanks electron for the reply..I am not a web designer and i dont know php.. Could you please explain me in detail step by step how to do this..I have a mysql database..Thanking u in advance. Share this post Link to post Share on other sites
electron 0 Report post Posted July 24, 2006 (edited) Here is the script in PHP that uses the File System to count each vist. <?php}$TextFile = "counter.txt";$Count = trim(file_get_contents($TextFile));$FP = fopen($TextFile, "r");$Count=fgets($FP, 4096);fclose ($FP);settype($Count, "integer");$Count++;if ($FP = fopen ($TextFile, "w")){fwrite ($FP, $Count);fclose ($FP);}?> I dont suggest to use the Database though Edited July 28, 2006 by electron (see edit history) Share this post Link to post Share on other sites
shahhitesh10 0 Report post Posted July 26, 2006 Thanks electron for the script.. but as i told you earlier i dont know php or web designing.I just know wusiwyg editing and copy paste only. Can you please explain me in detail what i have to do step by step.. Whether i have to make a php file of the below script or have to paste code somewhere else etc...Will the code below will make a table with two columns OR a table showing filename, size of file as i wrote in the first post.Please help this ignorat person electron..Thanks in advance Share this post Link to post Share on other sites
electron 0 Report post Posted July 28, 2006 Well that would be a little work.I think so u should request the Moderators to shift the topic to the PHP board.About the script I will have to recolloect how it was to be done for the downloads.You got to use the header function .I will write it but i need a day or so. Share this post Link to post Share on other sites
shahhitesh10 0 Report post Posted July 28, 2006 Ok never mind electron.. Take your time to do the work..But please explain the topic step by step..To moderators: please move this topic to PHP section as i think it is a php topic. Share this post Link to post Share on other sites