Table of Content:
-
Our users database
-
Adding some data to start with
-
Creating the login page
-
The users page
-
admin.php
-
Admin page structure
-
Conclusion
In today's tutorial we will be taking a look at creating a log in system using PHP Server Behaviors. Our system will provide an admin area for creating/editing and deleting users from the system, as well as the log in system itself. We'll be working with the newly released Dreamweaver MX 2004 for this article, as this will give us the opportunity to work with the new user authentication Server Behaviors that have been introduced with MX 2004.
After reading this tutorial, you'll be able to:
1. Create a table of users who could log into the site, along with their respective user access levels 2. Create a login page that authenticated users against that database table using the Log In User server behavior 3. Use the Restrict Access To Page server behavior, along with some of our own code to redirect authenticated users to the correct areas of our site 4. Use the Restrict Access To Page server behavior with defined access levels to make sure that only Admin users could access the admin section of the site 5. Use the Master-Detail Page Set application object to create a structure for the admin pages.
Allan comes from Cape Town, South Africa. He has been implicated in writing for several WROX, glasshaus, Wiley and Apress publications, generally in the 'cool stuff that PHP can do' sections.
You can catch up with him at his website http://www.mediafrenzy.co.za.