-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrayFunctions.php
More file actions
71 lines (63 loc) · 1.77 KB
/
Copy patharrayFunctions.php
File metadata and controls
71 lines (63 loc) · 1.77 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.txt
{
width:200px;
height:25px;
}
</style>
<title>ArrayFunctions</title>
</head>
<body>
<form method="POST">
<table>
<tr>
<td>
<label for="usr">Enter UserName:
</label>
</td>
<td>
<input type="text" name="usr" id="usr" class="txt" placeholder="Enter your unique usernamne"><br><br>
</td>
</tr>
<tr>
<td>
<label for="pass">Enter your password:</label>
</td>
<td>
<input type="password" name="pass" id="pass" class="txt" placeholder="******************">
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="shahebaz" value="submit"></td>
</tr>
</table>
</form>
<?php
$user ="naeem";
$pass = [12345, 67891, 14987];
print_r($_POST['usr']);
function check()
{
if ($_POST['usr'] == $user) {
echo "<script>alert('user matched');</script>";
} else {
echo "<script>alert('user does not matched');</script>";
}
// echo '<script>alert("This is inside the function check")</script>';
}
// print_r($_GET);
if (array_key_exists("shahebaz", $_GET)) {
check();
} else {
echo 'no';
}
?>
</body>
</html>