mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-06-25 09:33:36 +02:00
「🔨」 fix: fixed post request with cgi
This commit is contained in:
24
exemples/webpage/get_cgi.py
Executable file
24
exemples/webpage/get_cgi.py
Executable file
@ -0,0 +1,24 @@
|
||||
#!/nix/store/8w718rm43x7z73xhw9d6vh8s4snrq67h-python3-3.12.10/bin/python3
|
||||
# Import modules for CGI handling
|
||||
import cgi
|
||||
import cgitb
|
||||
|
||||
# Enable error reporting
|
||||
cgitb.enable()
|
||||
|
||||
# Create instance of FieldStorage
|
||||
form = cgi.FieldStorage()
|
||||
|
||||
# Set the content type to HTML
|
||||
print("Content-Type: text/html\n")
|
||||
|
||||
# Output a simple HTML page
|
||||
print("<html>")
|
||||
print("<head>")
|
||||
print("<title>CGI Script Test</title>")
|
||||
print("</head>")
|
||||
print("<body>")
|
||||
print("<h1>CGI Script is Running</h1>")
|
||||
print("<p>Your web server is working correctly!</p>")
|
||||
print("</body>")
|
||||
print("</html>")
|
Reference in New Issue
Block a user