Hey there, i need some help with a simple cgi script.
i cannot get it to write output to a file.
here is the script.
#!/usr/bin/python import cgi form = cgi.FieldStorage() Customer = form['Customer'].value Field = form['Field'].value data = [Customer, Field] reshtml = """Content-Type: text/html\n <html> <head><title>Customer Data</title></head> <body> <h1>Customer Data</h1> <p>Here ya go</p> </body> </html>""" print reshtml + 'Customer =' + data print ' ' + ' Field = ' + data # this is where the script fails to do anything.... OutFile = open("/home/nephish/Test.txt", "w") OutFile.write("Here is a spot of text to input") OutFile.close
it works, in that it returns the correct info to the browser,
but it does not write a text file.
i need to be able with this script to store on my disk what is input
in the html form.
any suggestions ?