Write the code that will process a submission from the login form, look up a user in the database, and determine if the user's password is valid.
- [Instructor] In this movie, we'll learn…to authenticate user access.…In other words, we'll write the code that will allow…a user to log in with a username and a password.…Before we dive in and look at the code,…I'm going to add a new file, it's in the exercise files,…it's called auth_functions.php, and I'm going…to put it in my private directory.…This is a place where I'm going to store…all of the functions related to authorizing a user.…And we'll just keep them separate from everything else.…So let's go into our code, and the first thing…I need to do is go to initialize.php,…and make sure that the authorization functions…are also required.…
So just add that right here, auth_functions.php.…Okay, so now that I have my authorization functions,…let's take a look at what's in them.…You see I have simply one function here…called log_in_admin, and when I pass it in,…an associative array for the admin,…this admin object that we're working with,…it's going to take care of all of the business…for logging in that user,…
- Creating a content management system
- Building dynamic content navigation
- Using context and function options for conditional behavior
- Hiding content from the public view
- Insecure direct object reference
- Allowing HTML in dynamic content
- Previewing content in the public context
- Working with cookies and sessions
- Storing status messages in the session
- Secure user authentication (login/logout)
- Regulating page access
- Nesting related resources
- Managing an ordered list automatically
Skill Level Beginner
1. Create a Content Management System
2. Build Dynamic Content Navigation
3. Use Context and Options
4. Cookies and Sessions
5. Regulate Page Access
6. Nesting Related Resources
Next steps1m 15s
- Mark as unwatched
- Mark all as unwatched
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.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.