hello members, I'm new here and would like some help ! My webpage has a 30 seconds timer which counts down to 0 and gives a result well the timer is known as x so my users don't wanna wait for it , they just cheat using the following code : javascript:var x=1 , is there anyway to prevent that from happening ? i hope you help me as fast as possible , this is really urgent . Thanks
use setTimeout or a framework like mootools or jquery. do this as an anonymous function on a delay // via mootools it would go... (function() { // code to run here after 30 seconds elapse. }).delay(30000); // via vanilla js it can be as: setTimeout(30000, function() { // what to run after it expires. }); PHP: unless you reference this as var timeController = setTimeout, even clearTimeout (or $clear in mootools) won't be able to stop the event or speed it up. make sure you leave the function as anonymous here and don't do something like: function showResults() { ... } setTimeout(30000, showResults); PHP: else, they can do javascript:showResults() instead of owning your timer.