| | |
User Authentication multiple user types
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2007
Posts: 86
Reputation:
Solved Threads: 6
Hi all,
I am not sure where to start with this one really. I have built the template for my site but, having a few issues in trying to impliment certain things that have to happen.
This site needs to have 3 types of user.
I am using a generalization of how the site works here because to get too specific will take up a lot of space.
1.) overall admin (that would be just me and one other person who needs unlimited access to do everything)
2.) general user
3.) Business
General user and Business have their own profiles, which are very different from eachother so they are in different tables.
The General user can search through profiles of the Business user and reserve an appointment (on the site), based on appointment information provided by the business profile.
Where I am running into the issue is, when a user logs in, I need to keep note of their user type so that I can keep them logged in throughout the site under that type. Pages will have different stuff loaded based on information in the user's profile. For instance, if a general user is logged in, they will see a list of new businesses to the site and "events" that those businesses may be sponsoring that are in their state, or zip code.
I know, my explination of the site isn't all that easy to understand, but, I was hoping that someone could stear me in the right direction here.
Perhaps cookies will do it, but, how would I set different cookies based on the user type (the user type is stored in a field in the user profile).
I know that I do not want to use javascript and that I don't want to add hidden form fields (which would require forms on every page).
Any help?
Thanks
Sage
I am not sure where to start with this one really. I have built the template for my site but, having a few issues in trying to impliment certain things that have to happen.
This site needs to have 3 types of user.
I am using a generalization of how the site works here because to get too specific will take up a lot of space.
1.) overall admin (that would be just me and one other person who needs unlimited access to do everything)
2.) general user
3.) Business
General user and Business have their own profiles, which are very different from eachother so they are in different tables.
The General user can search through profiles of the Business user and reserve an appointment (on the site), based on appointment information provided by the business profile.
Where I am running into the issue is, when a user logs in, I need to keep note of their user type so that I can keep them logged in throughout the site under that type. Pages will have different stuff loaded based on information in the user's profile. For instance, if a general user is logged in, they will see a list of new businesses to the site and "events" that those businesses may be sponsoring that are in their state, or zip code.
I know, my explination of the site isn't all that easy to understand, but, I was hoping that someone could stear me in the right direction here.
Perhaps cookies will do it, but, how would I set different cookies based on the user type (the user type is stored in a field in the user profile).
I know that I do not want to use javascript and that I don't want to add hidden form fields (which would require forms on every page).
Any help?
Thanks
Sage
Well if they are logged in as a user just store it in session data, the ID of that user at least so you can check when you display the content what the user level is in the database, like
SELECT level FROM user WHERE userID = $_SESSION['userID'] Something along those lines GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
You need to create a session that will keep track of the user.
Retrieve the userid, and usertype from the database, and save this in the session. Or you can just save the userid, and query the database for the usertype when you want to check their usertype.
http://www.php.net/session
Retrieve the userid, and usertype from the database, and save this in the session. Or you can just save the userid, and query the database for the usertype when you want to check their usertype.
http://www.php.net/session
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
•
•
Join Date: Jan 2008
Posts: 25
Reputation:
Solved Threads: 0
Hi there,i have joined newly to this site....I am a new to programming..i am developing a windows application using c#.net..I have the same problem stated by sagedavis but its windows application.
I have two types of users Admin and Normal users.
I am having one login screen.i want the application to identify the two types of users when they enter their username and password.
i saw the post of using session,but how to initialize the session and how to use it.....
The user login details for both admin and normal users are in a single table called account..
Help me out dude......
Thanks in advance......
I have two types of users Admin and Normal users.
I am having one login screen.i want the application to identify the two types of users when they enter their username and password.
i saw the post of using session,but how to initialize the session and how to use it.....
The user login details for both admin and normal users are in a single table called account..
Help me out dude......
Thanks in advance......
•
•
•
•
Hi there,i have joined newly to this site....I am a new to programming..i am developing a windows application using c#.net..I have the same problem stated by sagedavis but its windows application.
I have two types of users Admin and Normal users.
I am having one login screen.i want the application to identify the two types of users when they enter their username and password.
i saw the post of using session,but how to initialize the session and how to use it.....
The user login details for both admin and normal users are in a single table called account..
Help me out dude......
Thanks in advance......
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Jun 2009
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
Hi there,i have joined newly to this site....I am a new to programming..i am developing a windows application using c#.net..I have the same problem stated by sagedavis but its windows application.
I have two types of users Admin and Normal users.
I am having one login screen.i want the application to identify the two types of users when they enter their username and password.
i saw the post of using session,but how to initialize the session and how to use it.....
The user login details for both admin and normal users are in a single table called account..
Help me out dude......
Thanks in advance......
ok i have exact same question but in php not c#. have tried setting up restricted access depending on the usertype from database. but it only lets the user log in not the admin. any ideas?
![]() |
Similar Threads
- ASP.Net Security 101 Part 1 (ASP.NET)
- Linux Audio Streaming (live!) using Ices and Icecast (*nix Software)
Other Threads in the PHP Forum
- Previous Thread: Rank mysql search results by coulmn weighting
- Next Thread: Rewriting Block Content in Drupal
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube






