<%
Flag = request.form("Flag")
If IsEmpty(Flag) or Flag = "" then
%>
Back to Testimonies
<%
End If
If Flag = 1 then
If IsEmpty(request.form("Name")) or request.form("Name")="" then
response.write "
"
response.write "
You must enter a name.
"
response.write ""
response.end
Else
Name = request.form("Name")
End If
If IsEmpty(request.form("City")) or request.form("City")="" then
response.write "
"
response.write "
You must enter a City.
"
response.write ""
response.end
Else
City = request.form("City")
End If
If IsEmpty(request.form("Country")) or request.form("Country")="" then
response.write "
"
response.write "
You must enter a Country."
response.write "
"
response.end
Else
Country = request.form("Country")
End If
Email = request.form("Email")
If request.form("URL")="http://" then
URL = ""
Else
URL = request.form("URL")
End If
If IsEmpty(request.form("Comments")) or request.form("Comments")="" or request.form("Comments")=" " then
response.write "
"
response.write "
Don't forget to enter your comments!"
response.write "
"
response.end
Else
Comments = request.form("Comments")
Comments = Replace(Comments, Chr(34), "''")
Comments = Replace(Comments, vbCrLf, " ")
End If
Flag = request.form("Flag")
%>
Here's the information you're submitting.
If you would like to make changes, please click the "change"
button below, or submit this entry as it is.
Name
<%= Name %>
City
<%= City %>
Country
<%= Country %>
Email
<%= Email %>
Home Page
<%= URL %>
Comments
<%= Comments %>
<%
End If
If Flag = 2 then
Today = Now()
Name = request.form("Name")
Name = Replace(Name, "'", "''")
Name = Replace(Name, Chr(34), "''")
City = request.form("City")
City = Replace(City, "'", "''")
Country = request.form("Country")
Country = Replace(Country, "'", "''")
If request.form("Email")<>"" then
Email = request.form("Email")
else
Email = "na"
end if
URL = request.form("URL")
Comments = request.form("Comments")
Comments = Replace(Comments, "'", "''")
' ok now we've got our data so let's ship it off to the database
set conn = server.createobject("adodb.connection")
' **** change DSN name if you're using a DSN and you've named it differently
'conn.open "guestbook"
' **** DSN-less connection: comment out above line and uncomment the
' **** Code between "Begin" and "End"
' **** BEGIN DSN-LESS CONNECTION CODE
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("guestbook.mdb")
conn.mode = 3
conn.Open DSNtemp
' **** END OF DSN-LESS CONNECTION CODE
' **** Note: If using a DSN-less connection, make sure to change server.mappath above to
' **** reflect the actual location of the guestbook database file.
' **** The above will work if the database file is at the webserver root.
' **** See readme.txt for further information
' **** the following line would be used ONLY if you use a system DSN!
' conn.Open "guestbook"
SQLstmt = "INSERT INTO Guestbook (Name,City,Country,Email,URL,Comments)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & Name & "',"
SQLstmt = SQLstmt & "'" & City & "',"
SQLstmt = SQLstmt & "'" & Country & "',"
SQLstmt = SQLstmt & "'" & Email & "',"
SQLstmt = SQLstmt & "'" & URL & "',"
SQLstmt = SQLstmt & "'" & Comments & "'"
SQLstmt = SQLstmt & ")"
Set RS = conn.Execute(SQLstmt)
If err.number>0 then
response.write "VBScript Errors Occured:" & "