3. E – Commerce Website Tutorial – Create the PHP Admin Log In System

www.developphp.com In this 3rd video we will create the Admin Log In System for managing inventory and other store functions in the back end. We demonstrate a scripted method for database table creation in this example. The E – Commerce Web Site we will be assembling is one in which all of the inventory is in a MySQL database and we offer a custom PHP cart for a unique shopping experience. It is a site that handles sales, customers, and inventory.


  • Great tutorials man… thanks so much for doing this. I can now get started on the project I had no idea how to build. Cheers. Ed

  • Extremely thankful to you Adam for these tutorials. However, I am having problems with this lesson to work with my site. Went as far as changing my values to match yours so that all I would have to change after copy/paste of your code is the “include” script.

    After “submit”, I can see that the browser goes to the index page but I get redirected back to admin_login. I’m guessing “manager” isn’t getting set but I’ve copied your code for both admin_login & index.

    Please help.

  • ahw thank god.. was waiting for you to say: you can choose to hash this password. This turtorial will definitely help me out.

  • It was my server side that was the problems. After talking with them, they said “I have noticed that the session.save_path was not set in your account” and set it for me. I’m new to php./mysql and didn’t know what that meant. In any case, for those of you that are having trouble, check with your web host. There is absolutely nothing wrong with Adam’s code.

    Adam, thank you again for such a great tutorial.

  • I’m really enjoying this tutorial. I do have a question though. Video shows this programming line in the Admin/index.php:
    $managerID = preg_replace(‘#[^0-9]#i’,”,$_SESSION[“id”]);//filter everything but numbers and letters
    There is one too many or one less quotation marks missing. I can’t seem to find which it is. Can anyone help?

  • Hey Adam Great Tutorials so far… For everyone that wants to know like i did if you want the codes go to the last tutorial which is Part 20 and there is a link to the files with the codes

  • I dont get it you are sanitising your manager , password and id server side variables which as I understand dont get transfered they get created in your server and stay there and that list of server side variables is linked to a cookie (say id that makes sense only to webserver) . so if people can change variable in their browser they will only change that id and if that refers to another set of manager , username and id on ur server ..it still is on ur server the data itself is same

  • i apologise if in further lessons you correct this ..I am a beginnner but i think session variables dont get created in browser. a session id gets created but all the variables you are creating using _Session say only on the server .

  • hello sir
    my probl is that when open admin_login.php after that i put username n password n try to login to so i got this error :

    Warning: Cannot modify header information – headers already sent by (output started at /home3/mybaazar/public_html/storeadmin/admin_login.php:8) in /home3/mybaazar/public_html/storeadmin/admin_login.php on line 23

    so can u please tell me where is the error n reply me on sunesara_sahil@yahoo.com thnx you sir

  • please help when i type my username and pass and hit log in button it rederct my again to admin_login.php…… how to fix where is problem maby its xamp problem?

  • Im having Redirect Loops Problem at this point with the admin Page…. nothing comes up except the errors in Chrome and firefox.. ima sleep on it but aahhm if anyone here has any idea what could be wrong just comment on this post… peace

  • please help when i type my username and password and hit log in button it redercts to admin_login.php itself….. how to fix dis???

  • When I test the page after I hit the submit button it just redirects to the same page. It does the same thing if I enter the correct or incorrect username and password.

  • hello, when I go to enter your username and password to admin_login I get the message error, even if accurate, are the data I entered into the database .. what could be the problem?

Leave a Reply

Your email address will not be published. Required fields are marked *