Writing data to a text file
Download the authoritative guide: Data Center Guide: Optimizing Your Data Center Strategy
Download the authoritative guide: Cloud Computing: Using the Cloud for Competitive AdvantageIan Stallings
While writing a online signup form I decided to write some of the data to a text file for security reasons. I could've used a database, but the overhead isn't worth it and I only need notepad to open a text file. So, on to the code.
While writing a online signup form I decided to
write some of the data to a text file for
security reasons. I could've used a database, but
the overhead isn't worth it and I only need
notepad to open a text file. So, on to the code.
First we declare the textfile to be used and if it doesn't exist create it using this:
LogFile = Server.Mappath("log.txt")
Set OutStream=LogFileObj.OpenTextFile(LogFile, 8, TRUE)
New_line = Request.Form("UserName") & Chr(13) & Chr(10)
Now we can submit the info we want to collect from a form:
<form action="writetext.asp" method="post">
Username:<input type="text" size="20" name="UserName">
<input type="submit" name="submit">
For this script to work it must have write permission. The text file will be created in the same directory as the script. If you have questions or article ideas feel free to drop me a line.
IT Solutions Builder TOP IT RESOURCES TO MOVE YOUR BUSINESS FORWARD
Which topic are you interested in?
What is your company size?
What is your job title?
What is your job function?
Searching our resource database to find your matches...