View Single Post
  #4 (permalink)  
Old 05-03-2008, 03:59 PM
Michael Fesser
 
Posts: n/a
Diggs:
Default Re: How would I express this correctly

.oO(jsteinmann)

>this part in itself... how do I write this correctly?
>
>if ($row_rs['loggedinip'] != $_SERVER['REMOTE_ADDR'] AND now("Y-m-d
>H:i:s") < $row_rs['lastlogin']+120 minutes) {


If it has to be done in PHP, use Unix Timestamps for the calculation.
Turn the date in $row_rs['lastlogin'] into such a timestamp with
strtotime(). The current timestamp can be obtained with time(). Doing
the math should be quite simple then.

Micha
Reply With Quote