Hey guys. Got a quick question. I am having a problem with a message board that I am creating. I have created the log in and registration page and the sessions needed to use the site nad it all works fine, but when the user posts a message I can't get the unique user name to appear for the message that user posts. I can get it to appear as long as the users session is still valid, but once the user logs out, the session is terminated and the users name is gone from the message board. Please help?
jeffro25
0
Newbie Poster
Recommended Answers
Jump to PostAre you not storing the user id with the post? If you are then you just need to display the name associated with that id. The name (id) associated with a post should not have any dependency on whether a user is logged in.
Jump to PostIf the login name is the id for the user in the database, then that's fine to keep it in the session while they are logged in. You will still need to write that value to the database with the post though. The page that displays posts should retrieve the …
Jump to PostI've tried setting the $loginuser name and session variables to the user id in the database. Obviously not the right thing to do.
Actually, I would store both the user name and the id in the session. Whatever statement that saves the post just needs to include the id. The …
Jump to PostStill having problems with this...any ideas anyone?
Post the relevant code. Without that we can only speculate and offer generic suggestions.
All 13 Replies
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
jeffro25
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
jeffro25
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
jeffro25
0
Newbie Poster
jeffro25
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
jeffro25
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
jeffro25
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
jeffro25
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.