fork download
  1. #!/usr/bin/python3
  2. import cgi
  3. form = cgi.FieldStorage()
  4.  
  5. print('Content-type:text/html\n\n')
  6. print('<html>')
  7. print('<head>')
  8. print('<title>Project</title>')
  9. print('</head>')
  10. print('<body>')
  11. # The string has the {}, the variables inside format() will replace the {}
  12. print('<h3>Add Responsible for Reservation </h3>')
  13. # The form will send the info needed for the SQL query
  14. print('<form action="update_actions.cgi" method="post">')
  15. print('<p><input type="hidden" name="method" value="authorise"/></p>')
  16. print('<p>Start Date: <input type="text" name="start_date"/></p>')
  17. print('<p>End Date: <input type="text" name="end_date"/></p>')
  18. print('<p>Country: <input type="text" name="country"/></p>')
  19. print('<p>CNI: <input type="text" name="cni"/></p>')
  20. print('<p>Add Responsible: <input type="text" name="responsible"/></p>')
  21. print('<p><input type="submit" value="Submit"/></p>')
  22. print('</form>')
  23.  
  24. # Link will lead back to main page
  25. print('<a href="actions.cgi"><button>Back to Authorise/De-authorise Main Page</button></a> ')
  26.  
  27. print('</body>')
  28. print('</html>')
  29.  
Success #stdin #stdout #stderr 0.35s 20580KB
stdin
Standard input is empty
stdout
Content-type:text/html


<html>
<head>
<title>Project</title>
</head>
<body>
<h3>Add Responsible for Reservation </h3>
<form action="update_actions.cgi" method="post">
<p><input type="hidden" name="method" value="authorise"/></p>
<p>Start Date: <input type="text" name="start_date"/></p>
<p>End Date: <input type="text" name="end_date"/></p>
<p>Country: <input type="text" name="country"/></p>
<p>CNI: <input type="text" name="cni"/></p>
<p>Add Responsible: <input type="text" name="responsible"/></p>
<p><input type="submit" value="Submit"/></p>
</form>
<a href="actions.cgi"><button>Back to Authorise/De-authorise Main Page</button></a> 
</body>
</html>
stderr
./prog.py:2: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13