add text to html file

Results 1 to 2 of 2

Thread: add text to html file

  1. #1
    Join Date
    Dec 1969

    Default add text to html file

    I'm trying to take text entered into a textarea box in an html file and permanently insert it into or concatenate it to text in another html file. Any ideas?

  2. #2
    Join Date
    Dec 1969

    Default Use ASP and FSO?

    Submit the form to an ASP page.<BR><BR>Open the HTML file using ASP and the FileSystemObject.<BR><BR>Read lines of the HTML file up to the point where you want the insert to happen, writing them to a new file in the process.<BR><BR>Write the info from the form to the new file.<BR><BR>Continue reading and writing the old to the new.<BR><BR>Close both files. Delete the old file. Rename (uses the "MOVE" method of FSO) the new file to the old file name.<BR><BR>ALTERNATE:<BR><BR>If there is some kind of "marker text" in the existing HTML file, you could <BR><BR>Open the old HTML file and do a READALL to get all the text into a long string. <BR><BR>Use the VBS "REPLACE" function to replace the "marker text" with the text from the form.<BR><BR>Close the file. Reopen it for writing.<BR><BR>Write the entire string out to the file.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts