%@ LANGUAGE="VBScript" %>
<%
DebugMsgVis = False
Set objSSData = Server.CreateObject("ADODataServer.clsADO20")
DSN = "LAGB"
If Len(Request.Form) > 0 then
' ONLY ALLOW GUESTBOOK ENTRIES
' Fill out the complete URL of the valid addguest.asp page for this website
OnlyValidReferrer = "http://www.mightyechoes.com/"
strReferer = Request.ServerVariables("HTTP_REFERER")
If instr(1, strReferer,OnlyValidReferrer) <=0 Then
' redirect to valid input page
'Response.Write "strReferer = " & strReferer & "
" & vbCrLf
'Response.Write "OnlyValidReferrer = " & OnlyValidReferrer & "
" & vbCrLf
'Response.End
Response.Redirect OnlyValidReferrer
End if
guestname = SQLEncode(Request("guestname"))
email = SQLEncode(Request("email"))
url = SQLEncode(Request("url"))
city= SQLEncode(Request("city"))
state = SQLEncode(Request("state"))
country= SQLEncode(Request("country"))
comment = SQLEncode(Request("comment"))
postdate = CDate(Now())
if Trim(url) = "http://www" then
url = ""
end if
SQLStmt = "INSERT INTO meguest_tb "
SQLStmt = SQLStmt & "(name, email, url, city, state, country, comment, postdate) "
SQLStmt = SQLStmt & "VALUES ("
SQLStmt = SQLStmt & "'" & guestname & "', '" & email & "', '" & url & "', "
SQLStmt = SQLStmt & "'" & city & "', '" & state & "', '" & country & "', "
SQLStmt = SQLStmt & "'" & comment & "', '" & postdate & "');"
vResult = objSSData.ProcessSQLExecuteStatement(DSN, SQLStmt)
if vResult <> 0 then
Response.Write "Error: " & objSSData.ErrorCode & "
"
Response.Write "Desc: " & objSSData.ErrorDescription & "
"
if DebugMsgVis = True then
Response.Write "SQL: " & SQL & "
"
end if
elseif DebugMsgVis = True then
Response.Write "SQL: " & SQL & "
"
end if
End if
nameIdx = 0
emailIdx = 1
urlIdx = 2
cityIdx = 3
stateIdx = 4
countryIdx = 5
postdateIdx = 6
commentIdx = 7
SQLStmt = "SELECT name, email, url, city, state, country, postdate, comment FROM meguest_tb order by postdate desc"
vResult = objSSData.ProcessSQLSelectStatement(DSN, SQLStmt, vdata, vhdr, vrowcnt, vcolcnt, vremaining)
if vResult <> 0 then
Response.Write "Error: " & objSSData.ErrorCode & "
"
Response.Write "Desc: " & objSSData.ErrorDescription & "
"
if DebugMsgVis = True then
Response.Write "SQL: " & SQL & "
"
end if
elseif DebugMsgVis = True then
Response.Write "SQL: " & SQL & "
"
Response.Write "Rows: " & vrowcnt & "
"
Response.Write "Cols: " & vcolcnt & "
"
end if
%>
|
<% = vdata(ii, cityIdx) %> <% if Len(vdata(ii,stateIdx)) > 0 then %> <% if Len(vdata(ii,cityIdx)) > 0 then %> <% = ", " & vdata(ii,stateIdx) %> <% else %> <% = vdata(ii,stateIdx) %> <% end if %> <% end if %> <% if Len(vdata(ii,countryIdx)) > 0 then %> <% = vdata(ii,countryIdx) %> - <% end if %> <% = vdata(ii,postdateIdx) %> <% Next %> |