Viewers: in countries Watching now:
An important but little-understood concept in dynamic web development is that of role-based logins, which allow different types of users to access different parts of the site. In this course Adobe Certified Expert Candyce Mairs shows how to use Dreamweaver's features to create role-based logins, restrict page access, build an administrator area, and test everything to make sure it works. Plus, see how to set up a development environment and work with a database from within Dreamweaver. Along the way, build your skills in areas like working with PHP, adding form validation, using server behaviors, and much more.
Let's take our Administrative area tasks that we need to do as the programmer, and add them one at a time. So, we will start with the first link on the Administrative area page. Now, if I click in this link and have the Properties area open, I can see this is the Admin User Insert page. So, I will go over to that page, and what we're going to do is quickly do a review. First name, 40. This is the page that is correct in your Chapter 7 Start files, but is not correct in all prior Chapter files.
And it's always good to just zoom right through here and double check. Country is 30, perfect. Email, 50, that's our username. Password, password allows 15, which is perfect. However, our Password field was not created, so I did catch an error there that's why it's always good to go back through these. And our role is either set up as Guest or Admin. By default, when our administrative person opens this page, it will say Guest.
So, so far so good. I will Save this page. Now, how do we insert a new user within this area? Exactly the same as we inserted a new user when we did the Register page. So, I will select the Insert New User button. I will go over to the Server Behaviors panel within Dreamweaver, click the Plus sign within Server Behaviors and say, Insert Record. This first piece is our form name, the connection is correct.
This is our login connection, but we don't want to use the Country's Table. What we want is the Login Table. User ID, we are not using. The database will assign that for us. Username from Username, Password, Password. We'll just make sure these match up. And I do have them all matching automatically in this form. Prior in the course, we talked about matching them up manually if you need, too.
Now, after inserting is the only piece we need to set up. And what we're going to do is send our Administrative users to a page that has all of the users listed so that they can make sure, printed out on the page, that, that new user is listed there. So, we're going to send them to the Admin User List. I will click OK to insert a record. Now, we have the Insert Record piece done, but we have one other Server Behavior we're going to do at the same time.
And I will select this button here. Let me go back into Code View, and switch back. There we go. And I will select the Insert New User button. We want to assign this additional server behavior to this button as well. And what we want to do is make sure that it is a new username when that button is clicked. So, it's going to check for a new username before it will insert them into the database. The Username field is username.
If it already exists, we will send them to the Register page. Register Failed. That will let our administrators know that they were not able to insert that person into the database. Now, at some point, we may want to create a separate Admin page to give them more information. But for now, we'll use Register Failed. I will save this page, and we go out and double check the functionality. And within this area, if I try and add myself one more time, especially if I'm using the same email address.
Now, we don't have form validation set up on this form so that is something else we will want to do. So, I'll plug in my same information, role as a Guest, Insert New User, and you can see I was taken out to that Register page. It's not going to let me register. So, I know the check new username is working. Now, what I would want to do is add a new user and double test that functionality.
And I won't make you sit through watching me doing that process, but make sure you test that Insert Record Server Behavior as well. Now, our Admin area does not have access restricted yet, so only Admin users can work within this area. But our Insert Record, our Administrators area are now able to insert a user and they can insert an admin user not just the guest role coming from our website.
There are currently no FAQs about Dynamic Dreamweaver Websites: Creating Login Areas.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.