#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Sweden > Halland > Laholm
    Posts
    2
    Rep Power
    0

    Unhappy Problem with ASP :(


    Hello!
    I don't know if I've come to the right place? But i would be greatful if anyone could help me!

    I wan't to write some information from forms to file. and have managed to do that, but when I fill out the form once again, the new information over writes the old information! Is there a way to save the info?

    This is the file eith the forms:

    <form method="post" action="pg.asp">
    First Name: <input type="text" name="fname"><br>
    Last Name: <input type="text" name="lname"><br>
    <input type="radio" name="jname" value="M">MALE<br>
    <input type="submit" value="Send">
    </form>

    On submit ti will open the page pg.asp

    Thanks for filling out the form!
    <%
    dim fs,f
    set fs=Server.CreateObject("Scripting.FileSystemObject")
    set f=fs.OpenTextFile("C:/Inetpub/wwwroot/pd/exempel/test.txt", 2)
    f.Write(request.form("fname"))
    f.write(request.form("lname"))
    f.write(request.form("jname"))
    f.close()

    %>

    Is there a way to save the information (all of it) without writing over the old one!

    THANKS/
    Marcus
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    Adelaide
    Posts
    72
    Rep Power
    14
    What mode are you opening the file in? If you are opening it in the write mode then it will overwrite it but if you open it in the append mode it will add it to the end of the file.
    I hope this helps.

    Regards,

    Yoshi
    thats why i'm easy.....easy like sunday morning!
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Sweden > Halland > Laholm
    Posts
    2
    Rep Power
    0
    Thanks!

    I made a database to save the info in
    But now I know how to save info in a file too!

    /Marcus

IMN logo majestic logo threadwatch logo seochat tools logo