-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsachini.php
More file actions
51 lines (34 loc) · 1.05 KB
/
sachini.php
File metadata and controls
51 lines (34 loc) · 1.05 KB
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
49
50
51
<!DOCTYPE html>
<html>
<body>
<?php
if($_SERVER['REQUEST_METHOD']=="POST"){
$sachiniUsername = $_POST['sachiniUsername'];
$sachiniPassword = $_POST['sachiniPassword'];
$servername = "localhost";
$username = "abc";
$password = "123";
$db = "cms_user";
//Database Connection
$con = new mysqli($servername,$username,$password,$db);
if($con->connect_error){
die("Failed to connect to the database" .$con->connect_error);
} else{
$stmt = $con->prepare("select * from projectmanager where username = ?");
$stmt->bind_param("s",$sachiniUsername);
$stmt->execute();
$stmt_result = $stmt->get_result();
if($stmt_result->num_rows > 0){
$data = $stmt_result->fetch_assoc();
if($data['password'] == $sachiniPassword){
echo '<script>alert("Login Successfully"); window.location.href = "managerDashboard.php";</script>';
}
else{
echo '<script>alert("Invalid Email or Password");window.location.href = "sachini_html.html";</script></script>';
}
}
}
}
?>
</body>
</html>