Jump to content
xisto Community
shahhitesh10

Need A Java Script/ Help How to display download count on site?

Recommended Posts

:) 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

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

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 by electron (see edit history)

Share this post


Link to post
Share on other sites

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.