import os import cgi # Send an HTTP header indicating the content type as HTML print("Content-type: text/html\n\n") # Start an HTML document with center-aligned content print("") # Parse form data submitted via the CGI script form = cgi.FieldStorage() #Open file to write post contents file = open("/home/httpd/output", "w") for parameter in form : #print parameter value pair to file print(parameter, "=", form[parameter].value, file=file) file.close() # Close the HTML document print("")