<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Dim MM_editAction MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString) End If ' boolean to abort record edit Dim MM_abortEdit MM_abortEdit = false %> <%select case Request.Form("sicher1") case 1 sicher1 = "aefa" case 2 sicher1 = "hwob" case 3 sicher1 = "ioqm" case 4 sicher1 = "isef" case 5 sicher1 = "izps" case 6 sicher1 = "jfom" case 7 sicher1 = "kzap" case 8 sicher1 = "mbqh" case 9 sicher1 = "stya" case 10 sicher1 = "ungr" case 11 sicher1 = "yruc" case 12 sicher1 = "zuuy" case 13 sicher1 = "zxhx" end select %> <% if Request.Form("sicher")<>sicher1 then MM_abortEdit = true end if %> <% ' IIf implementation Function MM_IIf(condition, ifTrue, ifFalse) If condition = "" Then MM_IIf = ifFalse Else MM_IIf = ifTrue End If End Function %> <% If (CStr(Request("MM_insert")) = "form1") Then If (Not MM_abortEdit) Then ' execute the insert Dim MM_editCmd Set MM_editCmd = Server.CreateObject ("ADODB.Command") MM_editCmd.ActiveConnection = MM_iis_STRING MM_editCmd.CommandText = "INSERT INTO gaeste (datum, bemerkung) VALUES (?, ?)" MM_editCmd.Prepared = true MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 135, 1, -1, MM_IIF(Request.Form("datum"), Request.Form("datum"), null)) ' adDBTimeStamp MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 203, 1, 1073741823, Request.Form("bemerkung")) ' adLongVarWChar MM_editCmd.Execute MM_editCmd.ActiveConnection.Close sto = "anmeldung@mallner.at" sFrom = "anmeldung@mallner.at" sSubject = "Gästebucheintrag" sMailServer = "127.0.0.1" sBody = "Hallo!" & chr(10) sbody = sbody & request.Form("Datum") & " - " & request.Form("Bemerkung") set objmail = server.CreateObject("CDO.Message") Set objConf = Server.CreateObject("CDO.Configuration") Set objFields = objConf.Fields With objFields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = sMailServer .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Update End With With objMail Set .Configuration = objConf .From = sFrom .To = sTo .Subject = sSubject .TextBody = sBody End With objMail.Send set objfields = nothing set objconf = nothing set objmail = nothing End If End If %> <% Dim gaestebuch Dim gaestebuch_cmd Dim gaestebuch_numRows Set gaestebuch_cmd = Server.CreateObject ("ADODB.Command") gaestebuch_cmd.ActiveConnection = MM_iis_STRING gaestebuch_cmd.CommandText = "SELECT * FROM gaeste ORDER BY datum DESC" gaestebuch_cmd.Prepared = true Set gaestebuch = gaestebuch_cmd.Execute gaestebuch_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 gaestebuch_numRows = gaestebuch_numRows + Repeat1__numRows %> Unbenanntes Dokument

Gästebuch:
 
Ihr Sicherheitscode:
<%randomize codewert=INT(13 * RND() + 1) %>
<%if MM_abortEdit = true then response.Write("Code ist falsch! Geben sie bitte Ihren Sicherheitscode erneut ein:") else response.Write("Geben sie bitte Ihren Sicherheitscode ein:") end if %>
 

<% While ((Repeat1__numRows <> 0) AND (NOT gaestebuch.EOF)) %> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 gaestebuch.MoveNext() Wend %>
   
<%=(gaestebuch.Fields.Item("datum").Value)%> <%=(gaestebuch.Fields.Item("bemerkung").Value)%>
   
<% gaestebuch.Close() Set gaestebuch = Nothing %>