-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.html
More file actions
48 lines (40 loc) · 974 Bytes
/
process.html
File metadata and controls
48 lines (40 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
$username=$_POST['user'];
$password=$_POST['pass'];
/*
$username=stripcslashes($username);
$password=stripcslashes($password);
$username=mysql_real_escape_string($username);
$password=mysql_real_escape_string($password);
*/
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "users";
//connect to MySql
$conn = mysqli_connect($servername, $username, $password, $dbname);
if(!$conn)
{
echo "not connected";
}
$sql = "select * from users where username='$username' and password='$password'";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
header('Location: home.html');
echo "Login sucess ,Welcome" ,$row['username'];
}
} else {
header('Location: loginfail.html');
}
$mysqli->close();
?>
</body>
</html>