1.

Solve : PHP time/date?

Answer»

Hi,

I need a script that works with timestamps. (and databases)

If somebody logs in, the timestamp of the previous login of that person, should be loaded and on the screen you should see ' you have logged in 45454 seconds ago '

Of course, after that, the timestamp in the database should be updated.

Because I (dirty word) in PHP DATE; I'm hoping someone here can figure it out.

How are you TRACKING logins? By cookie or by database?A simple script won't do as APPARENTLY you are doing this on something else right? Or what's the meaning of this script?

time() returns the current UNIX time stamp in php and you can simply store it into database. It doesn't matter what the data type is in the database, a simple string would do.

When the VISITOR log in, you get the current time stamp with time() and fetch the last logged time stamp, do a subtraction and you get the interval between his or her login in seconds.Check the date of the last post.....



Discussion

No Comment Found