-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
23 lines (18 loc) · 763 Bytes
/
Copy pathprocess.php
File metadata and controls
23 lines (18 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
$username = $_POST['user'];
$password = $_POST['pass'];
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($username);
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!!! Welcome".$row['username'];
} else {
echo "Failed to login";
}
?>