-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhtmlinjection_post.php
71 lines (49 loc) · 1.56 KB
/
htmlinjection_post.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
<?php include_once "includer.php";
function checkInput($data)
{
switch($_COOKIE['security_level'])
{
case "0" :
$data = no_check($data);
break;
case "1" :
$data = xss_check_1($data);
break;
case "2" :
$data = xss_check_3($data);
break;
default :
$data = no_check($data);
break;
}
return $data;
}
?>
<div class="container">
<h1>HTML Injection - Reflected (POST)</h1>
<!--<a href="#">okan <script>alert(1)</script> </a>-->
<p>Enter your first and last name:</p>
<form action="<?php echo($_SERVER["SCRIPT_NAME"]);?>" method="POST">
<p><label for="firstname">First name:</label><br />
<input type="text" id="firstname" name="firstname"></p>
<p><label for="lastname">Last name:</label><br />
<input type="text" id="lastname" name="lastname"></p>
<button type="submit" name="form" value="submit">Go</button>
</form>
<?php
if(isset($_POST["firstname"]) && isset($_POST["lastname"]))
{
#echo print_r($_POST);
$firstname = $_POST["firstname"];
$lastname = $_POST["lastname"];
if($firstname == "" or $lastname == "")
{
echo "<font color=\"red\">Please enter both fields...</font>";
}
else
{
echo "Welcome ".checkInput($firstname)." ".checkInput($lastname);
}
}
?>
</div>