Results 1 to 4 of 4

Thread: How to count Button clicks on per page

  1. #1
    Join Date
    Apr 2009
    Posts
    79

    How to count Button clicks on per page

    I have a simple page designed where I have a button that is of download some items and a user clicks on the button, but I want to keep count on how many times the user has clicked on the button? how can i show the amount of times a button has been clicked on a textbox? so other visitor will also comes to know about the clicks...

  2. #2
    Join Date
    Mar 2008
    Posts
    258

    Re: How to count Button clicks on per page

    I will provide you the simple function which also takes me a very long time to find and implement it, Make a javascript function. Call that function each time the user click on the button. In javascript take a global variable to count the click. eg

    Code:
    var count 0;
    function count_click()
    {
    count++;
    return count;
    }
    This function will return you each count of user click.

  3. #3
    Join Date
    Feb 2009
    Posts
    62

    Re: How to count Button clicks on per page

    First, we need to determine what control fired the postback. There are three important things we have to do in the page load. Create a counter text file of the name hitcounter.txt and save it to the same directory you will put your hit counter in. Open your php editor. Save the document as counter.php. Set your opening statement for PHP script.When a button is clicked we need to know which one it is, and so does everyone else because when we make functions to scale the buttons down (actually just scales down the red MovieClip in the button) we don't want to scale down the button that was just clicked.

  4. #4
    Join Date
    Jan 2006
    Posts
    6,878

    Re: How to count Button clicks on per page

    Create a blank text file called hitcount.txt. This will be used to store the number of hits on a page, or across all pages. create the functionality for the other two buttons lets make the scaleButtonsUp and scaleButtonsDown functions because it will become very simple to understand what is happening with only code for one button. Upload this, and CHMOD it to '666' (there should be an option in your FTP program to do this - consult the Help files if you are not sure).

Similar Threads

  1. Replies: 2
    Last Post: 01-03-2012, 09:24 PM
  2. how do I get button click on PHP page?
    By Ramona19 in forum Software Development
    Replies: 7
    Last Post: 20-06-2011, 03:09 AM
  3. Replies: 4
    Last Post: 15-04-2011, 03:46 AM
  4. Replies: 6
    Last Post: 25-02-2011, 10:40 AM
  5. Previous Page button skips back multiple pages on Kindle
    By Reema_n in forum Portable Devices
    Replies: 4
    Last Post: 19-03-2010, 01:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,381,509.79762 seconds with 16 queries