+ Reply to Thread
Results 1 to 3 of 3

Thread: Please help over msn - mysql & php

  1. #1
    goldy30's Avatar
    goldy30 is offline x10Hosting Member goldy30 is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    60

    Exclamation Please help over msn - mysql & php

    I'm trying to set up a login where it allows two different access levels. members login will display a members area link... admin login displays both members and admin area links. Also once logged in a wecome message appears and echos the users email.

    It's half done but I've got problems and it's gotten a bit advanced for me to figure out. My msn is airbrushkits@live.com I can send you files for you to look at and I can upload to check.

    so I need help desperately asap, I've gone ahead and had help working out things too advanced for me and it's not finished. Due tomorrow. Help!

  2. #2
    mfurqanabid's Avatar
    mfurqanabid is offline x10Hosting Member mfurqanabid is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    37

    Re: Please help over msn - mysql & php

    create a field in database name user_priv (int 1) and use 0 for users and 1 for admin.

    Create 2 session

    if user is admin than

    $_SESSION['is_admin'] = 1;
    $_SESSION['is_member'] = 1;

    and if user than
    $_SESSION['is_admin'] = 0;
    $_SESSION['is_member'] = 1;

    retrieve these session into admin and members area and check that he have rights to access these pages or not......

  3. #3
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: Please help over msn - mysql & php

    what you would obviously have to do is add a new row into the user database called access or something similar. have admin's one level, regular users another level, etc...

    then what i do is have just the username and hashed password stored in cookies, then at the top of every page, i check those credentials against the database, then create unique variables to control the rest of it.

    for instance, if those credentials matched, i would create a new variable called $logged_in or something similar, and if they were an admin, make one called $is_admin, or $access_lvl = the level stored in the db. if the level is == 1 for instance, they would be a regular member, 2 would be a mod (if you've got any), 3 an admin, etc...

    then for the parts that only an admin should see make it if ($is_admin == TRUE) or if ($access_lvl == 3), show what the admin should see.
    Last edited by xPlozion; 11-25-2008 at 03:29 PM.

+ Reply to Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. Places to learn php
    By JaWasabi in forum Scripts & 3rd Party Apps
    Replies: 9
    Last Post: 01-13-2009, 02:03 AM
  3. [Cossacks] PHP Wont Load MYSQL DOWN
    By pasacom in forum Free Hosting
    Replies: 0
    Last Post: 08-26-2008, 12:30 AM
  4. PHP MySQL Question..
    By anuj_web in forum Programming Help
    Replies: 7
    Last Post: 04-26-2008, 05:43 AM
  5. Sigo con problemas con phpbb2
    By reciecho in forum Soporte
    Replies: 7
    Last Post: 10-20-2007, 06:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers