-
Notifications
You must be signed in to change notification settings - Fork 1
/
topost.html
33 lines (29 loc) · 892 Bytes
/
topost.html
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
<!DOCTYPE html>
<html>
<body>
<script>
const form = document.createElement('form');
form.method = "POST";
var items = location.search.substr(1).split("&");
for (let index = 0; index < items.length; index++) {
tmp = items[index].split("=");
let key = tmp[0];
let value = tmp[1];
if (key === "s") {
form.action = value;
continue;
} else if (key === "m") {
form.method = value;
continue;
}
const hiddenField = document.createElement('input');
hiddenField.type = 'hidden';
hiddenField.name = key;
hiddenField.value = value;
form.appendChild(hiddenField);
}
document.body.appendChild(form);
form.submit();
</script>
</body>
</html>