Displaying user specific information

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Apix
Forum Newbie
Posts: 8
Joined: Mon Jul 15, 2002 1:30 am

Displaying user specific information

Post by Apix »

I was wondering how you go about displaying specific user information? so when a user signs up. they are assigned a unique user id. Then next time they visit how do i make it so the script displays only there information. It could be done using member.php?user_id=theidnumer but it has to be secure. so only the person who knows the right user and password can view that persons information. I hope you understand what im trying to achieve.
ShrineMaster
Forum Newbie
Posts: 7
Joined: Mon May 20, 2002 5:33 am

Post by ShrineMaster »

Using sessions is pretty secure. If the browser gets shutdown the session cookies are usually removed.
http://www.php.net/manual/en/ref.session.php

If you want to go long term and keep the user logged in for multiple visits, you can use cookies. Instead of using the actual user id use some totally random string of letters and numbers in a cookie to identify the user. Reset the random string each time the user has to login, either from a new computer or if the cookie gets deleted.
http://www.php.net/manual/en/features.cookies.php

Good luck.
Post Reply