Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Create Login page with php and mysql

Create Login page with php and mysql

Ratings: (0)|Views: 6|Likes:
Published by Saba Wasim

More info:

Published by: Saba Wasim on Apr 01, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

05/12/2014

pdf

text

original

 
This is a simple website login system that has been very reliable and secure forme. I use it myself on my websites, when a simple login system is needed. If you know a little MySQL and PHP, it is very easy to use. If you need a PHP refresher course, I strongly recommend Simple PHP - you can learn the basics of PHP programming in just a few days! Here's how to create a simple website login systemusing PHP and MySQL.First, you will need to have MySQL installed on your computer. I have XAMMP installed and I use PHPmyADMIN for accessing my databases. They are free for download; just search for them online. You also need to create a database in your MySQL. And as you proceed, remember that linux server file names are always case sensitive. LOGIN.PHP is not equal to login.php like it would be on WINDOWS servers.how to make a loginRun this SQL command in your MySQL database (you must have one):CREATE TABLE `users` (`id` int(3) NOT NULL auto_increment,`login` varchar(8) default NULL,`password` varchar(8) default NULL,PRIMARY KEY (`id`)) TYPE=MyISAM AUTO_INCREMENT=3 ;This will create the table that will record the usernames and passwords.Then, create the LOGIN.PHP file. This page will contain the form that will submit the user´s data. <?session_name("MyLogin");session_start();session_destroy();if($_GET['login'] == "failed") {print $_GET['cause'];}?><form name="login_form" method="post" action="log.php?action=login">Login: <input type="text" name="user"><BR>Password: <input type="password" name="pwd"><BR><input type="submit"></form>Now, create the LOG.PHP. This is the file that performs the action of the form. <?session_name("MyLogin");session_start();if($_GET['action'] == "login") {$conn = mysql_connect("localhost","user","password"); // your MySQL connection data$db = mysql_select_db("DATABASENAME"); //put your database name in here$name = $_POST['user'];

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->