emma26iver Posted June 21, 2006 Share Posted June 21, 2006 I need a little help here, so I'm hoping you can help.I am creating a website for a friend, and she requires a members login section so people can sign up for registration to her services. For this I'm using a simple MySQL and PHP members directory database that I'm writing. The thing is, I want each user to have their own information displayed on the page, i.e their name at the top of the page etc. Her website is a female only taxi company. You can only use the services if you are registered. Each member will have to pay for their fare using credits. She wants members to be able to top-up their credits online using their credit card. Thus the reason why each member should have their own section, so they can check their balance.Can anyone let me know how to make each user go to their own section???Cheers!Emma Quote Link to comment https://forums.phpfreaks.com/topic/12535-phpmysql-database-question/ Share on other sites More sharing options...
teomanersan Posted June 21, 2006 Share Posted June 21, 2006 after you made the necessary settings (for.e.g checking user name and password is OK ) you have to add a unique variable to the user session such as<? $_SESSION['user'] = $user_info['nick']; ?>where $_SESSION['user'] is the variable which holds the nickname of the logged user as the session variable, $user_info['nick'] is the nickname of the user which is the user`s nick fetched from database(of course before assigning the session u have to make the necessary checks else it will cause security problems)in every page you have to get unique data`s for the logged member:<? session_start() ; // start the session , let`s check if member is logged properlyif(isset($_SESSION['user'] == FALSE) // if this member is not authorized ?{ include_once('login.php'); // show login page for authorization}else{ // fetch necessary data u`d like.. u can assign $_SESSION['nick'] to a variable and use it in your sql queries ,}hope this helps..good coding Quote Link to comment https://forums.phpfreaks.com/topic/12535-phpmysql-database-question/#findComment-48023 Share on other sites More sharing options...
emma26iver Posted June 22, 2006 Author Share Posted June 22, 2006 Thanks for that. Will give it a try and let you know how it turns out!Emma Quote Link to comment https://forums.phpfreaks.com/topic/12535-phpmysql-database-question/#findComment-48410 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.