25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- # coding: utf-8
-
- import cgi
- import cgitb; cgitb.enable()
- import glob
- form = cgi.FieldStorage()
-
- header = """
- <!DOCTYPE html>
- <head>
- <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
- <title>Envoyer une image</title>
- </head>
- <body>
- """
-
- print(header)
- password = form.getvalue("password")
- link = form.getvalue("link")
- choice = form.getvalue("choice")
-
- if link is not None :
- print("""<h2 class="w3-center w3-teal"> Confirmation </h2>""")
- print("""<h3 class="w3-left">Do you want to add this image to the """ + str(form.getvalue("choice")) + """ folder ? </h3> <br> <br>""" )
- print("<img class='w3-round' width=200px src='" + str(link) + "'>")
- formulaire = """<form action="download.py" method="post" class="w3-container"> """
- formulaire += "<p class='w3-wide'> Link </p>"
- formulaire += """ <input class="w3-input" type="text" name="link" value='"""
- formulaire += str(link) + "'"
- formulaire += ' > <br> <br>'
- formulaire += "<p class='w3-wide'> Folder </p>"
- formulaire += """ <input class="w3-input" type="text" name="choice" value='"""
- formulaire += str(choice) + "'"
- formulaire += ' " > <br> <br>'
- formulaire += '<input type="submit" value="Ok!" class="w3-btn w3-teal">'
- formulaire += '</form>'
- print(formulaire)
-
- else :
- if password is None:
- print("""<h2 class="w3-center w3-teal"> Send a picture </h2>""")
- formulaire ="""<form action="./upload.py" method="post" class="w3-container">
- <h3> Login </h3>
- <br>
- <input class="w3-input" type="password" name="password" value="" />
- <br>
- <input type="submit" name="send" value="Login" class="w3-btn w3-teal">
- <br>
- </form>"""
- print(formulaire)
-
- if str(password) == "TheBidouilleur" and link is None:
- print("""<h2 class="w3-center w3-teal"> Choose the folder </h2>""")
- print("""<h3 class="w3-center">Please choose a folder </h3>""")
- choice = """
- <title> choice des photos </title>
- <form action="./upload.py" method="post" class="w3-container">
- <select class="w3-select" name="choice">
- <option value="" disabled selected>Select a folder</option>
- <option value="Cities">Cities</option>
- <option value="Beaches">Beaches</option>
- <option value="Mountains">Mountains</option>
- <option value="Skies">Skies</option>
- </select>
- <br>
- <input class="w3-input" type="text" name="link" value="https://link_of_the/image.png" required>
- <br>
- <input type="submit" name="send" value="Download the photo" class="w3-btn w3-teal">
- </form>"""
- print(choice)
-
- elif str(password) != "TheBidouilleur" and password is not None and link is None:
- print("""<h2 class="w3-center w3-teal"> Connexion </h2>""")
- print("""<div class="w3-panel w3-red">
- <h2 class="w3-opacity">Mauvais MDP ! </h2>
- </div>
- """)
-
- formulaire ="""<form action="./upload.py" method="post" class="w3-container">
- <h3>Please enter password </h3>
- <br>
- <input class="w3-input" type="password" name="password" value="" />
- <br>
- <input type="submit" name="send" value="Login" class="w3-btn w3-teal">
- <br>
- </form>"""
- print(formulaire)
-
- end = """
- </body>
- </html>
- """
-
- print(end)
|