Results 1 to 2 of 2

Thread: HELP WITH SCRIPT (Enclosed)

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    usa
    Posts
    10

    Unhappy

    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

  2. #2
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    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
  •  



Click Here to Expand Forum to Full Width