Trooper Posted May 3, 2006 Share Posted May 3, 2006 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 Link to comment Share on other sites More sharing options...
SharkBait Posted May 3, 2006 Share Posted May 3, 2006 [!--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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.