1. Home
  2. Computing & Technology
  3. PHP / MySQL

PHP Login Script

By , About.com Guide

1 of 7

The Database

We are going to create a simple login system using PHP code on our pages, and a MySQL database to store our users information. We will track the users who are logged in with cookies.

Before we can create a login script, we first need to create a database to store users. For the purpose of this tutorial we will simply need the fields "username" and "password", however you can create as many fields as you wish.

CREATE TABLE users (ID MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, username VARCHAR(60), password VARCHAR(60))
This will create a database called users with 3 fields: ID, username, and password.
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Step By Steps
  5. Login PHP Script - Login PHP - Free Login PHP Script

©2009 About.com, a part of The New York Times Company.

All rights reserved.