Login Page

anivide

New Member
Messages
15
Reaction score
0
Points
0
guys i want to know how to create a log-in page using php codes....


a log-in page which will be looked like a registration page but only requires user-name and password....

and when they type a user-name and password....

the information they typed will be send to sql database
 

cjbonn2005

New Member
Messages
4
Reaction score
0
Points
0
First of all, the information the user submits isn't sent to the database, it is only cross-referenced to make sure the data they types is correct. For example:
PHP:
<?
$username = username submitted by user
$pass = password submitted by user
$login = mysql_query("SELECT * FROM login WHERE name='$username' AND pass='$pass'");
$login = mysql_fetch_array($login);
if(!$login){
$errormsg = "Incorrect Username/Password";
}else{
// add action for correct pass
}
?>
This is a brief example. Although this script will work, it is insecure.
 
Top