Jump to content


Photo

Last Visited


  • Please log in to reply
1 reply to this topic

#1 Trooper

Trooper
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 03 May 2006 - 06:24 PM

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.
~Trooper

#2 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 03 May 2006 - 10:19 PM

[!--quoteo(post=370994:date=May 3 2006, 11:24 AM:name=Trooper)--][div class=\'quotetop\']QUOTE(Trooper @ May 3 2006, 11:24 AM) View Post[/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 :2006-05-03 12:12:12

:D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users