Wednesday, July 21, 2010

HOW TO MAKE LOGIN FORM WITH PHP (authentic)

Posted by Syarif | Wednesday, July 21, 2010 | Category: |

if you login, there is a system that authenticate you, if you member or not. if you really a member, you will be directed into your private page. So, what is the system?
lets check this out.

name it (authentic.php):


<?php session_start();
if($_POST['ok']) {
$username = $_POST['username'];
$password = md5('$_POST[password]');
include"connect.php";
$query = mysql_query("SELECT *FROM user where username='$username' and password=md5('$password')");
$data = mysql_fetch_array($query);
echo ("welcome, $username!");
} else { echo ("Wrong Password/username");}
?>





preview page (if the user is authenticated):

Currently have 0 comments:


Leave a Reply