Jump to content

Last Visited


Trooper

Recommended Posts

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.
Link to comment
Share on other sites

[!--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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.