<%@ Language=VBScript%> <% option explicit dim flag if request.form="" then flag="" else flag = request.form("Flag") end if %> G Gordon Allen Guest Book
gordonallen.org
Guest Book
<% If flag = "" then %>

Note: * Indicates a required field.
First name:*
Last name:*
Address:
City/Town:*
State/Province:
Zip:
Country:*
Email:*
Phone:
Age: 1-19 20-29 30-39 40-49 50-59
60-69 70-79 80-89 90-99 100+
     
<% end if %> <% If Flag = "on" then dim FirstName, LastName, Address, City, State, Zip, Country, Email, Phone, Age FirstName = Request.form("FirstName") LastName = Request.form("LastName") Address = Request.form("Address") City = Request.form("City") State = Request.form("StateProvince") Zip = Request.form("Zip") Country = Request.form("Country") Email = Request.form("Email") Phone = Request.form("Phone") Age= Request.Form("Age") %>
gordonallen.org
Guest Book Confirmation

Thank you <%=FirstName%> <%=LastName%> for using our guest book.

You have submitted the following information.
If you would like to make changes, please use the appropriate button below. Use the Submit button to submit this entry as it is.

First Name: <%= FirstName %>
Last Name: <%= LastName %>
E-mail: <%= Email %>
Phone: <%= Phone %>
Address: <%= Address %>
City/Town: <%=City%>
State/Province: <%=State%>
Zip: <%=Zip%>
Country: <%=Country%>
Age: <%=Age%>
 
<%End If%> <% If flag = "off" then dim Today, Active, Name Today = Now() Active = "-1" FirstName = Request.form("FirstName") LastName = Request.form("LastName") Email = Request.form("Email") Phone = Request.form("Phone") Address = Request.form("Address") City = Request.form("City") State = Request.form("State") Zip = Request.form("Zip") Country = Request.form("Country") Age = Request.Form("Age") Name = FirstName + " " + LastName dim memberrs, MemberExists, memberconnection, SQL set memberconnection = server.createobject("ADODB.Connection") memberconnection.Open("DSN=gaguestbook;") Set memberrs = Server.CreateObject("ADODB.Recordset") SQL = "SELECT * FROM guestbook where LastName = '" & LastName & "' AND FirstName = '" & FirstName & "' AND Email = '" & Email & "'" memberrs.Open SQL, memberconnection IF memberrs.EOF Then MemberExists = "No" else MemberExists = "Yes" End IF memberrs.Close Set memberrs = nothing IF MemberExists = "No" Then dim rs, SQLstmt Set rs = Server.CreateObject("ADODB.Recordset") SQLstmt = "INSERT INTO guestbook(FirstName, LastName, Address, City, State, Zip, Country, Phone, Email, Age, RecordedOn, Active)" SQLstmt = SQLstmt & " VALUES (" SQLstmt = SQLstmt & "'" & FirstName & "'," SQLstmt = SQLstmt & "'" & LastName & "'," SQLstmt = SQLstmt & "'" & Address & "'," SQLstmt = SQLstmt & "'" & City & "'," SQLstmt = SQLstmt & "'" & State & "'," SQLstmt = SQLstmt & "'" & Zip & "'," SQLstmt = SQLstmt & "'" & Country & "'," SQLstmt = SQLstmt & "'" & Phone & "'," SQLstmt = SQLstmt & "'" & Email & "'," SQLstmt = SQLstmt & "'" & Age & "'," SQLstmt = SQLstmt & "'" & Today & "'," SQLstmt = SQLstmt & "'" & Active & "'" SQLstmt = SQLstmt & ")" rs.Open SQLstmt, memberconnection, 3, 3 'MailConfirmation Name, Email, "gordonallen.org Confirmation", "Congratulations! Welcome and thank you for registering in our quest book. We treasure your interest immensely and look forward to serving your needs.", "", "" 'rs.Close memberconnection.Close set rs = nothing Set memberconnection = nothing %>
gordonallen.org
Guest Book Updated


Thank you <%=FirstName%>  <%=LastName%> for using our guest book.

Your entry has been added.

<% Else memberconnection.Close Set memberconnection = nothing %>
gordonallen.org
Guest Book Error



Thank you <%=FirstName%>  <%=LastName%> for using our guest book.

This entry already exists.

We sincerely apologize. We do not permit multiple entries with the same account information.

<% End If end if %>