ueharataichou Posted January 25, 2010 Share Posted January 25, 2010 Greetings, I'm experiencing difficulties on coding a stopwatch for the memory game I'm coding. First I used for the time but later I found out that it's easy to hack the time by using Inspect Element so I'm opting to use a client-side script, php. The question is...how? I'm just a beginner in PHP so I don't know how to create one. It goes like this, the player clicks the Start button then timer starts, when the player finishes playing the game the timer stops and is saved in a variable and passed to MySql. Please help me. :'( Quote Link to comment https://forums.phpfreaks.com/topic/189696-php-timerstopwatch/ Share on other sites More sharing options...
oni-kun Posted January 25, 2010 Share Posted January 25, 2010 Greetings, I'm experiencing difficulties on coding a stopwatch for the memory game I'm coding. First I used for the time but later I found out that it's easy to hack the time by using Inspect Element so I'm opting to use a client-side script, php. The question is...how? I'm just a beginner in PHP so I don't know how to create one. It goes like this, the player clicks the Start button then timer starts, when the player finishes playing the game the timer stops and is saved in a variable and passed to MySql. Please help me. :'( Remember PHP is purely a server side language, You would require - A) To store start time in a unix timestamp, in a table - B) Get the difference and react as accordingly. If you require help on creating a database, Look on google. It's pointless to explain it all here when it could be bias information. You can use AJAX (which can be authenticated, but is a fairly secure) client side method of communicating with PHP when it is required to update the page without refreshing, such as your stopwatch checking. Quote Link to comment https://forums.phpfreaks.com/topic/189696-php-timerstopwatch/#findComment-1001131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.