smallc28 Posted October 2, 2013 Share Posted October 2, 2013 Hello I'm trying to create an recent view item for a mock up website of mine using Php & MySQL for an example if a customer viewed product A an they were to click on product B in the recent view section they would see product A thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/282622-help-creating-an-recent-view-item/ Share on other sites More sharing options...
trq Posted October 2, 2013 Share Posted October 2, 2013 Do you have a question? Quote Link to comment https://forums.phpfreaks.com/topic/282622-help-creating-an-recent-view-item/#findComment-1452138 Share on other sites More sharing options...
smallc28 Posted October 2, 2013 Author Share Posted October 2, 2013 Yes Actually, How would I go about starting off with this Session ? Quote Link to comment https://forums.phpfreaks.com/topic/282622-help-creating-an-recent-view-item/#findComment-1452139 Share on other sites More sharing options...
Ch0cu3r Posted October 2, 2013 Share Posted October 2, 2013 (edited) You'll could add product A to the $_SESSION, for now we'll call this var $_SESSION['recently_viewed']. So when the user is viewing a product, add its data to this variable. $_SESSION['recently_viewed'] = <products data here> To display recently viewed item you'd do something like if(isset($_SESSION['recently_vieweded'])) { // display recently viewed item data here } Edited October 2, 2013 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/282622-help-creating-an-recent-view-item/#findComment-1452159 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.