I have a javascript quiz which gets question data via an ajax call to PHPSCRIPT1.
At the same time I do this, I get the START TIME of the quiz via PHPSCRIPT1 and pass it back to the quiz.
At the end of the quiz I will pass the answer data and START TIME on to PHPSCRIPT2.The info will be processed and then stored in a database.
Rather than send the START TIME client side, I’d like to keep it on the server and send it directly to PHPSCRIPT2, so that it can be sent to mysql along with the answer data in the one query.
Is this possible? If yes, what methods can I use to pass the START TIME from PHPSCRIPT1 to PHPSCRIPT2?
If no, but you know a better way to keep START TIME server side I’d love to hear it.
Thanks.
EXTRA: I’m trying to avoid data going client side for fear they may be able to change the data.
If you want to develop a quiz, puzzle or so you surely want to use sessions (be they PHP standard sessions or roll-your-own ones). I am not aware of any other mechanism, that reliably glues together different pages of a webapp.
So it would be natural to store the start time in the session.