This is a very useful way to protect (Yahoo free web hosting)

This is a very useful way to protect your PHP files to limit use to logged-in users and administrators. However, there are a couple of minor drawbacks that you will solve later when you integrate the database-driven system: . This is manageable only for a few users with login information. . It s somewhat labor intensive when the need to move to a user-driven database system arises. This may seem to be a less-than-useful example, but it shows that you can protect pages so not just any Joe Shmoe can gain access to them. In fact, this example would work just fine if you needed to have just one or two users or administrators. You can have more, but that isn t easily managed, especially if you get numerous users. In the next section, you learn how you can use PHP in conjunction with MySQL to create user-driven login systems. You also learn how to allow multiple administrators, multiple usernames and passwords, and privilege levels that can be managed with the MySQL database. Using Database-Driven Information This section shows you what you can do with a database-driven Web site. Obviously, you will be using a MySQL database as your preferred database, but keep in mind that PHP can be used with many other databases as well. You will first set up a couple of tables in your database. For this, you will need a table schema (structured framework or plan). The next few steps are merely setup information so you have some usable data in the database that you can use with your PHP/MySQL pages. Call your database registration and your tables admin and user_info. You can go ahead and create the tables as necessary using one of the methods you learned in previous chapters. 1. First, create an administration table schema called admin. You won t be using this table information until the last section of the chapter, but because you are creating table schemas, you may as well do it now. This is where you can keep track of the administrators managing your system. CREATE TABLE admin ( username varchar(50) NOT NULL, password varchar(255) NOT NULL, first_name varchar(50) NOT NULL, last_name varchar(50) NOT NULL, email varchar(50) NOT NULL, admin_level int(2) NOT NULL, id int(10) NOT NULL auto_increment, PRIMARY KEY (id) ); 375 User Logins, Profiles, and Personalization
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.

Leave a Reply