web development India freelance website designer

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 & "

    1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700