Cflax Posted December 1, 2010 Share Posted December 1, 2010 Hello all...fairly new to this php/mysql thing... working on my final project thats due in about 24 hours... and i hit a rut... im making a pretty basic, online classifieds site. users can sign up, login, post new listings and view others listings by clicking on different categories. the problem i am having right now is this...When the user clicks on "My listings" i need it to pull only the listings that were created by that users user_id, which is the primary key in my user_info table...my professor suggested storing it in hidden field through the login submit button...very confused and frustrated... any help is much appreciated... Link to comment https://forums.phpfreaks.com/topic/220407-storing-logged-in-users-user_id-on-page/ Share on other sites More sharing options...
sweeb Posted December 2, 2010 Share Posted December 2, 2010 Hidden values in form buttons is pretty ghetto. Since your users are signing up and logging in you would need to store session variables to determine if that user is signed in as they click through pages (Very easy). So one of the session variables could be the user's username, and when they access the My Listings page you can run a query based on that session variable to pull all the corresponding listings. Link to comment https://forums.phpfreaks.com/topic/220407-storing-logged-in-users-user_id-on-page/#findComment-1142170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.