|
-
Sep 12th, 2000, 08:09 PM
#1
Thread Starter
New Member
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
-
Sep 12th, 2000, 08:27 PM
#2
Fanatic Member
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
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|