<%
'*****************************************************
'* Code written by Alexander Haneng (C) 1998-2001    *
'* FREE download from http://www.haneng.com/         *
'*****************************************************
%>
<HTML><BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<B>This is my guestbook. Use this form to submit your greeting:</B><BR>

<FORM METHOD="POST" ACTION="write.asp">
<INPUT NAME="new_line" TYPE="TEXT" SIZE=35>
<INPUT TYPE="SUBMIT" VALUE="Add greeting">
</FORM>
<BR><BR>
<%
  MyFile = "c:\guestbook.txt"
 
  'Opens the guestbook file if it exists
  Set MyFileObj=Server.CreateObject("Scripting.FileSystemObject")
  IF MyFileObj.FileExists(MyFile) THEN
    Set MyTextFile=MyFileObj.OpenTextFile(MyFile)

    'Reads a line, and outputs it
    WHILE NOT MyTextFile.AtEndOfStream
    %>
    <HR>
    <%=MyTextFile.ReadLine%>
    </HR>
    <%
    WEND

    'Closes the textfile
    MyTextFile.Close
  END IF' Does file exist
%>
<HR>
</BODY>
</HTML>

