Please subscribe to ProTycoon.com via the RSS Feed or Via Email.

Are you at the stage where your website needs to pass information from one page to another? If so then you might want to learn about PHP Sessions.

I have been asked to create a short tutorial to demonstrate how to make a simple PHP Login Script. I have put together 5 simple steps to help you get your PHP login script up and running in minutes.

Step 1: Create Members Table In Database

Before you can set up the Login Script you need to have the members table set up in your MySql database. Below is the code to create your members table:


CREATE TABLE `members` (

`id` int(4) NOT NULL auto_increment,

`username` varchar(65) NOT NULL default '',

`password` varchar(65) NOT NULL default '',

PRIMARY KEY  (`id`) ) TYPE=MyISAM AUTO_INCREMENT=2 ;

You then need to create a user that can be used to test the login script. This can be done using the code below:


INSERT INTO `members` VALUES (1, 'david', 'password');

Step 2: Create a Login Form

There are alot of HTML tags available to a web developer and it can be hard to remember them all. That is why I have knocked together a HTML Cheat Sheet that you can print out or bookmark, to help you remember HTML tags.

Many web-users will be familier with the acronym HTML, but few fully understand what it means at what it does. We have put together a short beginners guide to HTML, that we hope will help you make your first ever HTML web page.

  Search