Cookies or session storing start and end time...
Posted 01 August 2006 - 11:12 AM
Now I want to add a timer so in the end they can see how long time it took for them to answear it all.
I use just one file for this and use case 1: break; and so on.
Now I want to know the best secure way to store the start time and endtime and also print it into a file.
Because in the end of the test they can enter their name and a small message and they end up in the highscore. :-)
Is there a way to do this so if the time is stored from the start and then I can store another one in the end and show the start and endtime to the people.
If you don't undertsand what I mean say so and maybe I can explain better...
Posted 01 August 2006 - 11:31 AM
Good = If the user has cookies turn off they still work;
Bad = They expire when the browser is closed, or after a short while (Set in php_ini);
Good: They have a longer shell life;
Bad: If the user has cookies turned off, tough;
Posted 01 August 2006 - 12:07 PM
Or maybe test with cookies toi see if the user has them turned off and then use session?
Then also how would I use them to get the current date and time into a cookie or session and how do I read it out of them the best way?
Posted 01 August 2006 - 06:01 PM
If you just want to store a date/time a session will do the job
$_SESSION["start_time"] = date("Y-m-d H:i:s");
Or what ever format you want
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users