-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
44 lines (39 loc) · 912 Bytes
/
index.html
File metadata and controls
44 lines (39 loc) · 912 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>
antiCSRF JS Function by Mohammad Atwi
</title>
<meta charset="UTF-8">
</head>
<body>
<h4>antiCSRF JS Function by Mohammad Atwi test</h4>
<br>
<form action="server.php" method="post" id="form_1">
First name:<br>
<input type="text" name="firstname"><br>
Last name:<br>
<input type="text" name="lastname">
<input type="submit" value="Submit">
</form>
<br>
<br>
<br>
<button>Send an HTTP POST request to a page and get the result back (AJAX)</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script src="anticsrf.js?t=h"></script>
<script>
antiCSRF({'token' : '123456'}); // default setup
$(document).ready(function(){
$("button").click(function(){
$.post("server.php",{
name: "Donald Duck",
city: "Duckburg"
},function(data){
alert(data);
});
});
});
</script>
</body>
</html>