<%
Const bDeleteEntries = True
Dim bForce
bForce = Request.QueryString("force")
Dim strFile
strFile = Server.MapPath("libro_visitas.txt")
If Request.Form.Count = 0 Then
%>
<h3>Firma nuestro libro de visitas:</h3>
<form action="Libro.asp" method="post">
<table>
<tr>
<th align="right">Nombre:</td>
<td><input type="text" name="name" size="15"></input></td>
</tr>
<tr>
<th align="right">Comentario:</td>
<td><input type="text" name="comment" size="35"></input></td>
</tr>
</table>
<input type="submit" value="FIRMAR!!"></input>
</form>
<br />
<h3>Comentarios:</h3>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td>
<!-- #include file="libro_visitas.txt" -->
</td>
</tr>
</table>
<%
Else
Dim objFSO
Dim objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFile, 8, True)
objFile.Write "<strong>"
objFile.Write Server.HTMLEncode(Request.Form("name"))
objFile.Write ":</strong> "
objFile.Write Server.HTMLEncode(Request.Form("comment"))
objFile.Write "<br />"
objFile.WriteLine ""
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
%>
<H3>Tus comentarios se agregaron correctamente!</H3>
<A HREF="./Libro.asp">Volver</A>
<%
End If
If bDeleteEntries Then
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strFile)
If DateDiff("d", objFile.DateLastModified, Date()) <> 0 Or bForce <> "" Then
Set objFile = Nothing
Set objFile = objFSO.CreateTextFile(strFile, True)
objFile.Write "<strong>Tutores.org:</strong> "
objFile.WriteLine "Esperamos qur te guste este Libro!<br />"
objFile.Close
End If
Set objFile = Nothing
Set objFSO = Nothing
End If
%>