unique1801
Active Member
Hey ,
I knw a lil php . and i wana knw how to make a basic login (username and pass )system using sql
I knw a lil php . and i wana knw how to make a basic login (username and pass )system using sql
<html>
<head><title>Login System By NucleA</title></head>
<body>
<form method=GET action="login.php">
Username: <input type="TEXT" name="Username"><br/>
Password: <input type="TEXT" name="Password"><br/>
<input type="Submit" value="Login">
</body></html>
<?php
session_start();
mysql_connect("YOUR MYSQl SERVER", "MYSQL USERNAME", "MYSQL PASSWORD") or die(mysql_error());
mysql_select_db("Mysql Database") or die(mysql_error());
$username=$_GET['Username'];
$password=$_GET['Password'];
$ver=0;
$result=mysql_query("SELECT * FROM table") or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
if($username=$row['Username']){
$ver=$ver+1;
}
else{
echo "Invalid Username!";
}
if($password=$row['Password']){
$ver=$ver+1;
}
else{
echo "Invalid Password!";
}
if ($ver=2){
echo "Successfull Login!";
$_SESSION['User']=REGISTERED;
}
Hey ,
I knw a lil php . and i wana knw how to make a basic login (username and pass )system using sql