PHP/MySQL database question!
Posted 21 June 2006 - 12:44 PM
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???
Posted 21 June 2006 - 01:37 PM
<? $_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 properly
if(isset($_SESSION['user'] == FALSE) // if this member is not authorized ?
include_once('login.php'); // show login page for authorization
// fetch necessary data u`d like.. u can assign $_SESSION['nick'] to a variable and use it in your sql queries ,
hope this helps..
Posted 22 June 2006 - 09:26 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users