A simple login script that won't be much trouble for members in here. But query within is getting fired up for wrong credentials.
My Script.
<?php
require("C:\wamp\www\Onex\connect_db.php");
if(isset($_POST['login']) && !empty($_POST['login']))
{
$uname=$_POST['uname'];
$pass=$_POST['pass'];
$login_query="select * from register where username='$uname' and password='$pass'";
$result=mysqli_query($con,$login_query);
if($result)
{
echo "Login granted. <br>";
while($row=mysqli_fetch_array($result))
{
echo " Username: ".$row["username"]." and Password: ". $row["password"];
}
}
else
{
echo "No such user registered.";
}
}
mysqli_free_result($result);
mysqli_close($con);
?>
Do tell me if i need to add snaps ?
I need not tell how much I appreciate your help. :-)