HI,
Use a cookie to store the time the user is already logged on in each session
that cookie will contain the number of minutes the user has been logged.
When your page load it sets another cookie to 10:00 witch is the user start
time. on logout just add the time difference between 10:00 and 11:00
currenttime forexample to the cookie so your cookie now has 60 minutes of
use. When this cookie is over 2880 upadte the lesson in the database. But
you user needs to logout correctly to count the time hes been online.
Hope this helps
"Radwan Aladdin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi..
>
> I'm trying to make a PHP code that do the following :
>
> Inserts the server time to the database (When login). and then insert it
again (When logout). Now I want to compare the two values to know the
defference between them by minutes.. so for example : if the defference was
2880 minutes then update a value in the database (Value in database + 1)..
and every 2880 minutes I want to add "1" to the value..
>
> This for lessons in my project.. the lessons must be updated every 2880
minutes.. but not automatically.. I mean the user can login for 60 minutes
for example and then after 10 days he can login again and see the same
lesson.. so every 2880 minutes the user stay in the program.. the lesson
will be updated..
>
> I tried to make it but everytime wrong.
>
> I hope you got me well..
>
> Waiting your help and thanks in advance..
>
> Best regards..
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to