PHP timer for a javascript function -
i have setinterval
timer , stores information database. somehow people manage cheat me. need php function calculate time since javascript timer has started , save time in db? possible?
i think call php script using ajax call setinterval. can use in you're ajax complete callback :
var end = new date().gettime(); var time = end - start; // start defined before ajax call console.log('execution time: ' + time);
if need calculate form server-side, use time() in php
Comments
Post a Comment