Jump to content

Last Visited


Trooper

Recommended Posts

[!--quoteo(post=370994:date=May 3 2006, 11:24 AM:name=Trooper)--][div class=\'quotetop\']QUOTE(Trooper @ May 3 2006, 11:24 AM) [snapback]370994[/snapback][/div][div class=\'quotemain\'][!--quotec--]
What is the best way to do a system where it uploads the last time you visited a page using PHP and MySQL? I need this so I know to change a image if there was a new update since the user last visited, like what happens on the forums.
[/quote]

If you keep track of your users via a database like MySQL you can have a field in the table called last_visited which can be a timestamp. Upon logging into the site you would set it with NOW().

Just make sure you pull the date from the database prior to updating it with the new on. Store it in a variable or a session so that you can retrieve it and then display it back to the user.


You last visted us on :[i]2006-05-03 12:12:12[/i]

:D
Link to comment
https://forums.phpfreaks.com/topic/8990-last-visited/#findComment-33143
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.