HomePHP Page 10 - Building an E-Commerce Site Part 2: Managing Users with Sessions
Step 7: Putting It All Together - PHP
This is the second article in a three-part series dealing with using PHP 4 and MySQL to make a comprehensive e-commerce storefront solution. This article covers session management within the store, user privileges, and a few security concerns.
We've covered the sessions as well as user management. We've also gone over the changes that have happened since part 1 of this guide. Now let's put everything together. Open up mymarket/ with your browser and you should see the (boring) home page. Now click on the "login" link and sign on as:
First thing you should do is change your password! Next, go to the administrative home page and create a new user account (that doesn't have the "admin" privilege). Note you should specify a real email address when doing this because the password is going to get sent to that email address.
TROUBLESHOOTING EMAIL: If your PHP4 refuses to send email, make sure the settings in the [mail function] section of your php.ini are correct.
Now log out and try to access the administrative pages in mymarket/admin, notice that it asks you to login first. Neat-o isn't it :) Okay, just keep playing with the system until you're comfortable with it.
As always, go over the code and comments while you play with the system to get a good feel for what is happening. Stay tuned for the next part where we look at letting customers (regular users) to look through the product catalog and order things!