I am trying to make a simple application that counts and displays the number of times a user clicks within a box on a webpage. What language should I be using to do this? Any suggestions on just how to do it? +reps for useful responses.
Use Javascript. <head> <script> <!-- var count = 0; --> </script> </head> <body onclick="alert(count++);"> </body> PHP: You can put the onclick on a <div> to control the size and you can output the count++ to an <input> or you can use simple AJAX like Javascript/PHP to save it to a database or text file.
Use Javascript to activate onclick. Use Ajax to call a PHP page in the onclick function. The PHP page will increment +1 to the user clicks. Peace,
AJAX / PHP is probably overkill, stick with the Javascript if it's just a fun game. If there's actually something of value involved that needs to be tracked, then use a server side language like PHP.
Thanks for the help so far. I am trying to make an application that counts the number of times you click within a box in a given time frame. I am having trouble figuring out how to make the timing part work though, the only things I can find is a function that has a time delay until the code executes. Help?