<%@ 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.andyjforest.com/guest/" 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")) 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 ajfguest_tb " SQLStmt = SQLStmt & "(name, email, city, state, country, comment, postdate) " SQLStmt = SQLStmt & "VALUES (" SQLStmt = SQLStmt & "'" & guestname & "', '" & email & "', " 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 ajfguest_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 %> Andy J. Forest
<% if ShowDebugMsg = True then %>

sql insert = <%= SQLstmt %>

<% end if %>

Thanks for visiting my site!
Make sure you
leave us a note.



<% For ii = o to vrowcnt-1 %>
<% = vdata(ii,commentIdx) %>
<% = vdata(ii,nameIdx) %> <% ML = vdata(ii,emailIdx) ML_Text = HyperPart(ML,1) ML_Link = HyperPart(ML,2) if Len(ML_Link) > 0 then %> <%= ML_Link %> <% 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 %>

Home | Music | Bio | Gigs | Links | Pics | Guestbook | Email

Website Design & Hosting by:
LAlink, Inc