May 26th, 2005, 11:56 PM
Join Date: May 2005
Time spent in forums: 1 h 41 m 42 sec
Reputation Power: 0
simple cgi script snafu
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.
form = cgi.FieldStorage()
Customer = form['Customer'].value
Field = form['Field'].value
data = [Customer, Field]
reshtml = """Content-Type: text/html\n
<p>Here ya go</p>
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")
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 ?