Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

User authentication

From: Dynamic Dreamweaver Websites: Creating Login Areas

Video: User authentication

We are now going to take a look at adding the log in functionality for our Scoopity-U website. What I have at this point is the login page open. This log in page does have two spry fields on it. In case yours does not within the chapter six start files there is a log in spry completed file you can use as a base and copy that as login.php. If you did not get the log in spry piece completed.

User authentication

We are now going to take a look at adding the log in functionality for our Scoopity-U website. What I have at this point is the login page open. This log in page does have two spry fields on it. In case yours does not within the chapter six start files there is a log in spry completed file you can use as a base and copy that as login.php. If you did not get the log in spry piece completed.

So here is our log in form. Now in order to add functionality to this form. First of all, using spry. We're making sure that the user has to insert information into the form. So let's preview that and let's try that one more time, because it sent me to the log in spry page instead. Here we go. Log in PHP. So I have two fields on this form, Email and Password.

If I do not enter anything into either field, you can see this is what happens. And if I don't enter correct email information into this area it gives me the message please enter a valid email address. So, what I can do is I've already registered for the website so my email address is in the log in table. And when I registered, I put PWD inside here.

I will click Login, and I'm logged in, or not. We have no idea. We haven't added any funtionality to this page. And the idea is if I click Login and I can't login, I should be sent to a different page otherwise it's very confusing. So let's go out and create a page for users who cannot login. I'm going to open up template.php. This is just a basic page, we can save.

And I'm going to save it as Login-now. The reason I'm adding the dash is it will put this page in alphabetical order with the rest of them. If I said no login, this page would go way down below. So it just helps me keep these pages together. Now, my naming convention for the rest of the pages is using camel casing, in other words, every word but the first one is capitalized.

So I'll use that same naming convention here. Click Save, and up at the top here I'm going to say, Your Login Did Not Work. And down below I will say, If you do not have an account please register to use this area. Use the members' area.

And I'll register, I'll double-click that word. There we go. And we will create a link to the register page here. So click on Point To File, this little icon here in Dreamweaver, drag out to the Register Page and, I, now have a hyperlink. I'll save this page and there's where we're going to send them if it doesn't work. Now let's add some functionality besides form field validation.

And the way we do that is select the button what you need to do is tell Dreamweaver what needs to happen in order to trigger this behavior to run. Specifically the login user server behavior so I will select the Submit button when the user clicks that that's when we want this to happen. I will now go out to the server behaviors panel. And just in case yours is not open, you can always get to it through the Window menu.

I'm going to hit the plus sign. Go down to User Authentication, and say Login user. Now this looks complicated but it's really divided up into multiple sections, so it's not too hard. The first thing we need to do is fill in the form name. Well, we didn't name this form anything specific, down in this area, you can see our form is named Form one. So that's where that is coming from. The user name field is our email field. And the password field is password.

Dreamweaver populated these three correctly for us. What we need to do is tell Dreamweaver which database we're going to authenticate against. Which table to use within that area and which columns. So our Username column will be username. Password will be pwd. If the login succeeds we're going to send them to the members' home page. So this is the home page for our members.

If the login did not work, we're going to browse out and send them to the login no page. So, if it succeeds we should end up on members home. If it doesn't, we should end up in the login no page. And we're going to restrict access based on user name and password, and access level. We're going to get the access level fromINAUDIBLE within this area.

We will click OK, and there we are. Now, there's our login form. Within our login user, if we want to change anything we click this login user area. Now I'm only going to log in people based on username and password for now. We haven't set up the administrative area so we don't have to restrict this to any particular access level. So I am going to switch that back to user name and password and click OK. Now what it should do is actually function for us. So let's go out to preview this in the browser.

I will plug in my email address and make sure you're using one that you are actually registered for. Notice our password field here hasn't been change to a password. Another reason we want to test these, so we can modify that when we go back. I'll click Login. You can see I was taken to the members area page without a problem. So my login worked. What if I have a login issue, and I'll put my name in. But I'll just put a bad password.

And it's not my actual password. I want to make sure that it prevents me from seeing the members' area. So I will click Login, and it did. So our login piece is set up. Let's fix our password field. And within this password field area. We have some information in here. And if I get into the text field. Here's our information. I'm going to go into Split View to make this a little bit easier, so I'll select the spry text field, and the reason this is not set up as a password is because if I click inside this field for password you can see that this is not a password here.

We also have two labels for our password. One is set up here, here is the other one. So we don't need this top one here. I'll get rid of this one. So I'm just cleaning up some code that occurded. And this is actually the label for password. This an accessibility issue. And let me move up to show you that. So we have our spry text field right here. Within our text field, we have a label, and this label in other words, this word, password is the label for this specific form field.

This tells a screen reader, that this is the word that should be read to describe this form field. So we'll just clean that up a little bit. Some how. There was some extra coating within that area. Under ID, I will also set it to just password because we ended up with an additional label within this area, Dreamweaver added the ID of pwd2 because you cannot have two ID's within the same page. So there we are, we are all set and our login should be working correctly.

And we've cleaned up our password area now let me just go double check that password area and make sure if I enter something it's a password perfect our login form is all set including functionality. Now what we need to do is go out and make sure that we restrict access to our pages. Because right now anybody can go out to Member Home. So there's one last piece we need to set up. And you can see this page is not fully set up within out site.

So we'll move out into the Member area and take a look at those pages and get those all fixed. So we have a complete login process.

Show transcript

This video is part of

Image for Dynamic Dreamweaver Websites: Creating Login Areas
Dynamic Dreamweaver Websites: Creating Login Areas

43 video lessons · 1848 viewers

Candyce Mairs
Author

 
Expand all | Collapse all
  1. 1m 32s
    1. Welcome
      1m 32s
  2. 2m 57s
    1. Course overview
      1m 16s
    2. The course environment
      1m 41s
  3. 26m 58s
    1. Static vs. dynamic requests
      4m 8s
    2. Installing XAMPP on a Windows system
      8m 54s
    3. Installing MAMP on a Mac system
      4m 29s
    4. Using admin consoles
      3m 54s
    5. Installing the course files
      5m 33s
  4. 18m 36s
    1. Overview of the Dreamweaver interface
      6m 22s
    2. Setting up the course site
      6m 20s
    3. Previewing pages
      5m 54s
  5. 33m 38s
    1. Creating PHP pages
      5m 45s
    2. Adding PHP code
      5m 44s
    3. Displaying variables
      4m 45s
    4. Commenting your code
      5m 30s
    5. Working with includes
      5m 58s
    6. Building the course templates
      5m 56s
  6. 35m 13s
    1. What is a database?
      5m 2s
    2. Adding database tables
      7m 34s
    3. Connecting to the database
      8m 28s
    4. Getting data from a database: Part one
      8m 25s
    5. Getting data from a database: Part two
      5m 44s
  7. 1h 16m
    1. Planning the login process
      7m 25s
    2. Creating a login form
      7m 45s
    3. Adding form validation: Part one
      9m 22s
    4. Adding form validation: Part two
      1m 37s
    5. Exploring the registration page
      7m 17s
    6. Correcting table fields
      6m 1s
    7. Setting up the login landing page
      4m 1s
    8. Using server behaviors
      3m 36s
    9. Inserting new members
      8m 48s
    10. User authentication
      10m 3s
    11. Restricting access to pages
      5m 17s
    12. Testing the login
      4m 53s
  8. 1h 6m
    1. Admin area overview
      5m 9s
    2. Adding new users
      5m 19s
    3. Restricting access
      12m 25s
    4. Planning the admin update area
      5m 19s
    5. Building the members table listing
      6m 55s
    6. Building the querystring
      9m 14s
    7. Populating the update form
      6m 33s
    8. Updating the database data
      11m 28s
    9. Testing the admin update process
      3m 47s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dynamic Dreamweaver Websites: Creating Login Areas.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

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.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.