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

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -