Now notice in Figure 12-17 that the admin (Top web site)
Now notice in Figure 12-17 that the admin logged in here is able to update the user but is not allowed to delete the user because you did a check with the first if statement to see what the admin s level is. Should Joe log in with a level of 1, he would see something similar to Figure 12-18. Figure 12-18 Depending on what link he chooses and whether he has a high enough admin level, the admin will be able to update or delete the user s account. To guard against an admin of lower level trying to navigate to the delete page and supply a user ID through the query string, you inserted this line of code: if ($_SESSION[ admin_level ] == 1 ) This checks the admin level and notifies the admin that he or she doesn t have privileges to delete a user s account. You then provide a link back to the admin area. Now that you have learned how to use database-driven information with an administration section, you should be on your way to creating login systems for your own personal site or for your clients. 412 Chapter 12
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.