Jump to content

storing logged in users user_id on page


Cflax

Recommended Posts

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

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