mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-06-25 09:33:36 +02:00
「🏗️」 wip: post kinda working
This commit is contained in:
BIN
exemples/webpage/catually.png
Normal file
BIN
exemples/webpage/catually.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
11
exemples/webpage/index.html
Normal file
11
exemples/webpage/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<style>
|
||||
body {
|
||||
background-color: #1e2024;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<h1 style="font-size: 3rem; font-weight: bold; color: #fff; text-align: center; letter-spacing: 2px; background: linear-gradient(90deg, #ff00ff, #00ffff); -webkit-background-clip: text; display: inline-block; border-bottom: 2px solid #fff;">evilge</h1>
|
||||
</body>
|
||||
</html>
|
13
exemples/webpage/not_found.html
Normal file
13
exemples/webpage/not_found.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Not found D:</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>The page you requested was not found. Here is an image of Kanel instead</h1>
|
||||
<img src= "https://send.kanel.ovh/hotlink/xA0pJbJY6vuwjvGjpXHde6Y7WSVs7VF0qWp8y9YS.png" width="500" height="500">
|
||||
</body>
|
||||
</html>
|
||||
|
20
exemples/webpage/omg.html
Normal file
20
exemples/webpage/omg.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>POST Request Test</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test POST Request</h1>
|
||||
<form action="/test.py" method="post">
|
||||
<label for="name">Name:</label>
|
||||
<input type="text" id="name" name="name" required>
|
||||
<br>
|
||||
<label for="email">Email:</label>
|
||||
<input type="email" id="email" name="email" required>
|
||||
<br>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
30
exemples/webpage/test.py
Executable file
30
exemples/webpage/test.py
Executable file
@ -0,0 +1,30 @@
|
||||
#!/nix/store/kjvgj2n3yn70hmjifg6y0bk9m4rf7jba-python3-3.12.10/bin/python3
|
||||
|
||||
import cgi
|
||||
import cgitb
|
||||
|
||||
# Enable error reporting
|
||||
cgitb.enable()
|
||||
|
||||
print("Content-Type: text/html") # HTML is following
|
||||
print() # blank line, end of headers
|
||||
|
||||
form = cgi.FieldStorage()
|
||||
|
||||
# Get data from fields
|
||||
name = form.getvalue("name")
|
||||
email = form.getvalue("email")
|
||||
|
||||
print(f"""
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>POST Request Received</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>POST Request Received</h1>
|
||||
<p>Name: {name}</p>
|
||||
<p>Email: {email}</p>
|
||||
</body>
|
||||
</html>
|
||||
""")
|
Reference in New Issue
Block a user