| Inputs:Name, email address, URL, and comments
Returns:HTML Output into txt file
Assumes:This script does not use a database!!
This is very important! Make sure that you have a file called guestbook.txt With the following text inserted:
Another thing is the Error validation. You don't have To include that if you don't want to. Usually, I have had people
email me about scripts that are too easy to Get into, so I made a couple of required fields. The challange was the email part.
INFINITY PRODUCTIONS GUESTBOOK
'the data requested and stuff Flag = Request.form("Flag") if Flag = 1 Then Name = Request.form("Name") Email = Request.form("Email") Url = Request.form("Url") Comment = Request.form("Comment") Comment = server.HTMLencode(Comment) 'Don't allow HTML Comment = Replace(Comment,VbCrlf," ") 'fun stuff! error validation errmsg=" " if Replace(Name," ","") = "" Then errmsg = errmsg & "- Name is missing
" if Replace(Email," ","") = "" Then errmsg = errmsg & "- Email Address Is Missing
" ElseIf InStr(Email,"@")=0 Then 'all emails contain an at sign eg. you@you.com errmsg = errmsg & "- Email Address Is missing an '@'
" ElseIf InStr(Email,".")=0 Then 'all emails contain a dot eg. you@you.com errmsg = errmsg & "- Email Address needs To be something like somebody@somwhere.com
" End if 'URL is not required if Replace(Comment," ","") = "" Then errmsg = errmsg & "- Comment is missing
" errmsg = errmsg & " " if Not errmsg ="" Then %>
<%= errmsg %>Please click the back button on your browser, or click here and fix these errors.
Response.end End if 'end of error routine
Newrecord = "" Newrecord = Newrecord & "" & VbCrlf Newrecord = Newrecord & "
|