-
Notifications
You must be signed in to change notification settings - Fork 1
/
join.cgi
executable file
·40 lines (35 loc) · 1.02 KB
/
join.cgi
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
#!/usr/bin/python3
from os import getenv
from urllib.parse import unquote_plus as unquote
from urllib.parse import quote
import utils
import sys
import codecs
import os
import json
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
utils.printcgiheader("text/html")
try:
gameid = utils.parseurl(getenv("QUERY_STRING"))["game"]
page="""<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Secret Hitler – Přidej se k již založené hře</title>
</head>
<body>
<h1> Secret Hitler – Přidej se ke hře!</h1>
<form action="join2.cgi">
<label for="name">Jméno: </label><br>
<input type="text" id="name" name="name"><br>
<label for="game">Hra: </label><br>
<input type="text" id="game" name="game" value="{}" readonly><br>
<input type="submit" value="Potvrdit">
</form>
</body>
</html>
""".format(gameid)
print(page)
except:
utils.redirect("error.html")
raise