-
I use this Script to post text to a file. How can I get this script to create a new file each time its called upon?
What im trying to do is have it create a new seperate file each time the form is submited and have these files collect in the folder they are created in. such as:
order1.txt
order2.txt
order3.txt
etc...
Is this possible to create?
Script:
===========================================================
<%
Dim filesys, txtfile
Set filesys = CreateObject("Scripting.FileSystemObject")
Set txtfile = filesys.CreateTextFile("d:\home\Orders.txt", True)
dim item
for each item in Request.Form
txtFile.WriteLine (Request.Form (item))
next
txtfile.close 'close the file
set txtFile = nothing
%>
============================================================
Thanks in Advance
-
a simple way would be to put the date at the end, ie.
Code:
<%
Dim filesys, txtfile
Set filesys = CreateObject("Scripting.FileSystemObject")
Set txtfile = filesys.CreateTextFile("d:\home\Orders" & Year(Now) & Month(Now) & Day(Now) & ".txt",True)
dim item
for each item in Request.Form
txtFile.WriteLine (Request.Form (item))
next
txtfile.close 'close the file
set txtFile = nothing
%>
otherwise, you must store the new number somewhere(an other file maybe), then jus incriment it. For code, repost