<% '******************************************************* '* Original template from: * '* ASP 101 Sample Code - http://www.asp101.com * '* Modified for Net-Prospect.com * '* Robert Becker 3-21-02 * '******************************************************* %> <% ' String variable to store the path / file we write to ' Note: This file needs to exist BEFORE you run this script! Dim strFile strFile = Server.MapPath("registered_list.html") ' If the script doesn't have anything posted to it we display the form ' otherwise we process the input and append it to the guestbook file. If Request.Form.Count = 0 Then '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Display the entry form. - A.K.A. the "BEFORE" page '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' %> <% Else ' Log the entry to the guestbook file Dim objFSO 'FileSystemObject Variable Dim objFile 'File Object Variable ' Create an instance of the FileSystemObject Set objFSO = Server.CreateObject("Scripting.FileSystemObject") ' Open the TextFile (FileName, ForAppending, AllowCreation) Set objFile = objFSO.OpenTextFile(strFile, 8, True) ' Log the results ' This formatting assumes the top of the file we are appending to ' is already formatted to define a four column table objFile.Write "" objFile.Write Server.HTMLEncode(Request.Form("name")) objFile.Write "" objFile.Write Server.HTMLEncode(Request.Form("email")) objFile.Write "" objFile.Write Server.HTMLEncode(Request.Form("loc")) objFile.Write "" objFile.Write Server.HTMLEncode(Request.Form("comment")) objFile.Write "" objFile.WriteLine "" ' Close the file and dispose of our objects objFile.Close Set objFile = Nothing Set objFSO = Nothing '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Tell people we've written their info - A.K.A. the "AFTER" page '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' %> <% End If %>