Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 05-09-2009
Member
 
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...
Reply With Quote
  #2  
Old 05-09-2009
Member
 
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.
Reply With Quote
  #3  
Old 05-09-2009
Member
 
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.
Reply With Quote
  #4  
Old 05-09-2009
Member
 
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).
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to count Button clicks on per page"
Thread Thread Starter Forum Replies Last Post
Why Safari 5.1 relaoding web page while using back button or gesture? Raj G Technology & Internet 2 01-03-2012 09:24 PM
how do I get button click on PHP page? Ramona19 Software Development 7 20-06-2011 03:09 AM
Unable to find my favorites button on IE9 and System moves to IE9 page while installing IE8 Chopfyt Technology & Internet 4 15-04-2011 03:46 AM
Mac OSX error message? INVALID VOLUME FILE COUNT and INVALID VOLUME DIRECTORY COUNT? Aaghaz Operating Systems 6 25-02-2011 10:40 AM
Previous Page button skips back multiple pages on Kindle Reema_n Portable Devices 4 19-03-2010 01:50 PM


All times are GMT +5.5. The time now is 04:19 PM.