-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHTML injcation
52 lines (47 loc) · 1.06 KB
/
HTML injcation
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
<?php
//Code not fixt
if(isset($_POST['submit'])){
$inpout= strtolower($_POST['search']);
$inpout= str_replace("<script>","",$inpout);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML injcation</title>
</head>
<body>
<form method="POST" action="">
<center>
<?php echo $inpout."<br>";?>
<input type="text" name="search">
<input type="submit" name="submit">
</form>
</body>
</html>
<?php
//code Fixt
if(isset($_POST['submit'])){
$inpout= strtolower($_POST['search']);
$inpout= str_replace("<script>","",$inpout);
$inpout= str_replace("on","",$inpout);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML injcation</title>
</head>
<body>
<form method="POST" action="">
<center>
<?php echo $inpout."<br>";?>
<input type="text" name="search">
<input type="submit" name="submit">
</form>
</body>
</html>