Code2Design.com

User login

The Layout

Programming

Graphic Design

Resources

Navigation

C2D Projects

Unsystematic Affiliates

Tutorial Mix Christian Cosmos Pixel Depth AK Pro 

Change Language

Who's online

There are currently 0 users and 13 guests online.

Membership and User Authentication

Members-system (using My-Sql)

PHP and MySQL login-system

Here I will teach you how to create a really basic login-system for use in php and mysql. The system can easily be built on to work with flash and other applications.

I'll just start:

First you need a "data.php" file that looks like this:

<?php
 
$dbc 
mysql_connect("localhost","***username***","***password***"); mysql_select_db("***db_name***"); 
session_start();
?>

You also need a database with a table (registered) with fields that look like the SQL code below. (If you want, you can copy it into phpMyAdmin and it will create the table.)

CREATE TABLE `registered` (
`id` int(11) NOT NULL auto_increment,
`username` varchar(64) NOT NULL,
`password` varchar(32) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;


Submitted by Alxandr on August 29, 2007 - 5:32pm.
read more | 10 comments

Syndicate content


Like what you see?

Why not add more? C2D is looking for other Christian Web Masters who would like to help write articles for this site. If you have expericance in FLASH, CSS/HTML, PHP/MySQL, PhotoShop/GIMP, Blender, Javascript, or just General Design - our users would love to hear what you have to say. Contact Us

delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   technorati