PDA

Click to See Complete Forum and Search --> : help


Jay=B
Nov 20th, 2000, 03:40 PM
Can someone tell me why this does not display anything on my webpage.

<HTML>
<HEAD>
<Title>Guestbook</Title>
</HEAD>
<BODY>
<%

Dim strFile

strFile = Server.Mappath("guestbook.txt")
If Request.Form.Count = 0 then
%>
<H2>Sign My Guestbook: </H2>
<Form Action ="Guestbook.asp" Method = "post">
<p>Name: <Input Name = "name" Type = "TEXT" SIZE = "30" Maxlength = 40" ></p>
<P>Email: <Input Name = "email" Type = "TEXT" SIZE = "40" Maxlength = "50" ></p>
<p>Comment: <TextArea Name = "comment" Rows = "7" Cols = "35"></Textarea></p>
<Input Type ="submit" Value = "Sign GuestBook"></p>
</Form><BR>
<H3>Today's Comments:</H3>


<%

Else
Dim objFSO
Dim objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFso.OpenTextFile(strFile, 8, True)
objFile.Write "<B>"
objFile.Write "Guest #:"
objFile.Write "</B> "
objFile.Write Server.HTMLEncode(Request.Form("name"))
objFile.Write "said "
objFile.Write Server.HTMLEncode(Request.Form("comment"))
objFile.Write " on 11/14/00"
objFile.Write "<BR>"
objFile.Write " <B>Email: "
objFile.Write Server.HTMLEncode(Request.Form("email"))
objFile.Write "</B>"
objFile.Write "<BR>"
objFile.WriteLine ""
objFile.Close
Set objFile = Nothing
Set objFile = Nothing
%>
<H3>Your comments have been written to the file!</H3>
<A href="./Guestbook.asp">Back to the guestbook</A>
<% End if %>
</Body>
</HTML>


Thanks in advance

HarryW
Nov 20th, 2000, 05:42 PM
If Request.Form.Count = 0

Perhaps this evaluates to False?