Skip to main content
Known Participant
July 23, 2009
Question

php access level from login

  • July 23, 2009
  • 2 replies
  • 3255 views

using php to build a login. i have 14 different pages. I want 14 users with their own un/pw to see his/her own page. in my db i setup users name pw access level. i also in dw use the restrict page bassed on access level. however where do i set who goes to which page? example. Im a football player,  i log in under football and get the football page. if i log in under baseball i get the baseball page.

can you help?

This topic has been closed for replies.

2 replies

Known Participant
July 23, 2009

What if I just did a simple php if statement based on access level. example if access leve = '' redirect to (url)?

DwFAQ
Participating Frequently
July 23, 2009

How do you determine the access level? Through a session variable.

You could try the other way and if that works for you that's great!

DwFAQ
Participating Frequently
July 25, 2009

Great. but i have new question:

How do i populate a text input field with a word based on user access level.

exp. if im user football_player and my access level is leader i want a text

input filed on form page to say Dallas.

Can you help me?


Create session variable for everything you want filtered then use an if statement to show results from recordset.

if ($user == "football_player" && $access_level == "coach") {

   <?php echo $recordset_value['dynamic_text']; ?>
}

DwFAQ
Participating Frequently
July 23, 2009

Set access level by using a session variable. Look here for info on how to create a session variable. Then use an if statement to direct to access page based on session variable. By default DW creates a session variable MM_Username you can create a filtered recordset from this session variable to create additional session variables for other database table fields for logged in user.

Does that help?

Known Participant
July 23, 2009

Ill try it. thanksl