Hjælp til message board
Jeg kan ikke få message board til at virke, når jeg browser siden kommer der en fejl. Den står at den ikke kan finde book.txt.Min asp fil (guestbook.asp)
<%
Const bDeleteEntries = True
Dim bForce
bForce = Request.QueryString("force")
Dim strFile
strFile = Server.MapPath("guestbook.txt")
If Request.Form.Count = 0 Then
%>
<H3>Sign Our Guestbook:</H3>
<FORM ACTION="http://pc-kan2/karsten/guestbook.asp" METHOD="post">
<TABLE>
<TR>
<TD ALIGN="right"><B>Name:</B></TD>
<TD><INPUT TYPE="text" NAME="name" SIZE="15"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right"><B>Comment:</B></TD>
<TD><INPUT TYPE="text" NAME="comment" SIZE="35"></INPUT></TD>
</TR>
</TABLE>
<INPUT TYPE="submit" VALUE="Sign Guestbook!"></INPUT>
</FORM>
<BR>
<H3>Today''s Comments:</H3>
<!-- Instead of doing this in script, I simply include
the guestbook file as is -->
<!--#INCLUDE FILE="book.txt"-->
<%
Else
Dim objFSO
Dim objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFile, 8, True)
objFile.Write "<B>"
objFile.Write Server.HTMLEncode(Request.Form("name"))
objFile.Write ":</B> "
objFile.Write Server.HTMLEncode(Request.Form("comment"))
objFile.Write "<BR>"
objFile.WriteLine ""
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
%>
<H3>Your comments have been written to the file!</H3>
<A HREF="./guestbook.asp">Back to the guestbook</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 "<B>John:</B> "
objFile.WriteLine "I hope you like our guestbook!<BR>"
objFile.Close
End If
Set objFile = Nothing
Set objFSO = Nothing
End If
%>