#!/usr/bin/python
# Save parameter to a file
# Import modules for CGI handling 
import cgi, cgitb, os 

# Create instance of FieldStorage 
form = cgi.FieldStorage() 

# Get data from fields
outMessage = form.getvalue('msg')
   
# write message to file
text_file = open("har_messages.json", "w")
text_file.write(outMessage)
text_file.close()

#print "Content-type:text/html\n\n"
#print "<html><body>"
#print "Here is the message<br>"
#print outMessage
#print "<br>"
#print "</body></html>"
