Forum Moderators: open
form page...
<form name="ContactUs" method="post" action="network_status_updater_confirm.asp">
<p>New Network Status:</p>
<textarea cols="60" name="Comments"></textarea><br>
<input type="submit" name="Submit" value="Submit">
</form>
confirm page
<%
' Create instance of FileSystemObject
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
' Create the text file
Set myFile = objFSO.CreateTextFile(Server.MapPath("news.txt"))
' Write each Form key and value to the text file created above
myFile.WriteLine Request.Form("Comments")
myFile.Close
%>
---header, body tags etc---
<%
Set fileObj=Server.CreateObject("Scripting.FileSystemObject")
Set listFile=fileObj.OpenTextFile(Server.MapPath("news.txt"), 1)
Response.Write(listFile.ReadLine)
listFile.Close
Set listFile=Nothing
Set fileObj=Nothing
%>
It works on one server im testing on (dont know specs), but my production server (IIS 6) gives me a 500 error after submit.
any help would be greatly appreciated
Permissions needed to write to files are significantly different. I had some similar problems just trying to access .xsd files from the same box vs. having to do it through a remote connection.
Keep us posted on what you find.