-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayroll_app.php
77 lines (72 loc) · 2.12 KB
/
payroll_app.php
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
220 ProFTPD 1.3.5 Server (ProFTPD Default Installation) [192.168.56.5]
350 File or directory exists, ready for destination name
250 Copy successful
221 Goodbye.
HTTP/1.1 200 OK
Date: Sat, 09 Apr 2022 11:01:04 GMT
Server: Apache/2.4.7 (Ubuntu)
Last-Modified: Sat, 09 Apr 2022 11:01:04 GMT
ETag: W/"6f2-5dc36a09cbe99"
Accept-Ranges: bytes
Content-Length: 1778
Connection: close
<?php
$conn = new mysqli('127.0.0.1', 'root', 'sploitme', 'payroll');
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>
<?php
if (!isset($_POST['s'])) {
?>
<center>
<form action="" method="post">
<h2>Payroll Login</h2>
<table style="border-radius: 25px; border: 2px solid black; padding: 20px;">
<tr>
<td>User</td>
<td><input type="text" name="user"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td><input type="submit" value="OK" name="s">
</tr>
</table>
</form>
</center>
<?php
}
?>
<?php
if($_POST['s']){
$user = $_POST['user'];
$pass = $_POST['password'];
$sql = "select username, first_name, last_name, salary from users where username = '$user' and password = '$pass'";
if ($conn->multi_query($sql)) {
do {
/* store first result set */
echo "<center>";
echo "<h2>Welcome, " . $user . "</h2><br>";
echo "<table style='border-radius: 25px; border: 2px solid black;' cellspacing=30>";
echo "<tr><th>Username</th><th>First Name</th><th>Last Name</th><th>Salary</th></tr>";
if ($result = $conn->store_result()) {
while ($row = $result->fetch_assoc()) {
$keys = array_keys($row);
echo "<tr>";
foreach ($keys as $key) {
echo "<td>" . $row[$key] . "</td>";
}
echo "</tr>\n";
}
$result->free();
}
if (!$conn->more_results()) {
echo "</table></center>";
}
} while ($conn->next_result());
}
}
?>