2. Create another table to store users and (Free web hosting with ftp)
2. Create another table to store users and their information. Call this table user_info and create it with the following schema: CREATE TABLE user_info ( email varchar(50) NOT NULL, username varchar(50) NOT NULL, password varchar(255) NOT NULL, first_name varchar(50) NOT NULL, last_name varchar(50) NOT NULL, city varchar(50) default NULL, state varchar(50) default NULL, hobbies varchar(255) default NULL, id int(10) NOT NULL default 0 ); 3. Add a couple of administrators to your database, using your preferred method. (Two will be added here as an example, but you can add as many as you want.) This example uses John Doe and Jane Doe. Keep in mind that you will be using these in all the examples we create here: INSERT INTO admin (username, password, first_name, last_name, email, admin_level, id) VALUES ( johndoe , PASSWORD( jane ), John , Doe , john@johndoe.com , 1 , ); and INSERT INTO admin (username, password, first_name, last_name, email, admin_level, id) VALUES ( janedoe , PASSWORD( john ), Jane , Doe , jane@janedoe.com , 2 , ); You now have a couple of administrators set up in your admin table, so you can begin to create the registration portion of your PHP code to allow users to register and log in, and update their information or delete their accounts if needed. You will again be using sessions to track your users, and you will also be using some cookie information to keep persistent logins between sessions should the user want that option. Try It Out Session Tracking with PHP and MySQL In this exercise, you create a user login system. You will create it so that the user is required to input a username, password, first name, last name, and e-mail address. The other fields will be optional. 1. First, create an index page that looks for login information similar to the previous example, but don t include an authorization page so that you can show different content based on whether or not the user is logged in. This allows the user the chance to log in if he or she wishes to. Call this page index.php, and use the following code to create it: Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.