I created a simple login portal but there are some issues and I tried several solutions.
This is my login.php
file.
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<link rel="short icon" href="sopraicon.ico">
<link rel="stylesheet" href="login.css">
<body>
<form method="POST" action="process.php" >
<img src="soprasteria.png" alt="sopra steria" width="20%" align="center">
<img src="share.png" alt="share" id="img1" align="right">
<a href=""> <img src="search.png" id="img1" align="right"></a>
<input type="text" class="search" name="search" placeholder="Search.."><br>
<br> <div class="sidediv"></div>
<p class="data">Sign in to Sopra Steria</p><br>
<h3 class="h3">User Login</h3>
<br><img src="Login.jpg" alt="login iamge" height="150px" width="170px"
align="left" style="padding-left:160px"><br>  <b>Username:</b>
<br>  <input type="text" placeholder="User Name" name="username"
required id="text">
<br>  <b>Password:</b><br>  <input type="password"
placeholder="Enter Password" name="password" required id="text" min="8">
<br>  <button type="submit" id="logbtn"
name="submit">Login</button><br>
<div class="bottomdiv"></div>
</form>
</body>
</head>
</html>
This is my process.php
file
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$username = stripcslashes($username);
$password = stripcslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
mysql_connect("localhost","root","");
mysql_select_db("login");
$result = mysql_query("select * from users where username='$username'
and password='$password'") or die("failed to query
database".mysql_error());
$row = mysql_fetch_array(result);
if($row['username']==$username && $row['password']== $password){
echo"login success";
}
else{
echo"failed";
}
?>
but I get error on WAMP server as you see in the image. Please help me.. Thank you.