<!--#include file="includes/top.asp"-->
<%
dim comm_naam, comm_datum, comm_text, comm_dag, comm_maand, comment_ip,comm_code, date_part
dim arrMaandenLang(12), arrDagen(7)
set objConn = server.CreateObject("ADODB.Connection")
objConn.Open strConnection
Set objRS=Server.CreateObject("ADODB.Recordset")
arrMaandenLang(1) = "januari"
arrMaandenLang(2) = "februari"
arrMaandenLang(3) = "maart"
arrMaandenLang(4) = "april"
arrMaandenLang(5) = "mei"
arrMaandenLang(6) = "juni"
arrMaandenLang(7) = "juli"
arrMaandenLang(8) = "augustus"
arrMaandenLang(9) = "september"
arrMaandenLang(10) = "oktober"
arrMaandenLang(11) = "november"
arrMaandenLang(12) = "december"
arrDagen(1) = "zondag"
arrDagen(2) = "maandag"
arrDagen(3) = "dinsdag"
arrDagen(4) = "woensdag"
arrDagen(5) = "donderdag"
arrDagen(6) = "vrijdag"
arrDagen(7) = "zaterdag"
if (Request.Form("commentplaatsen") <> "") then
' Form verwerkt
comm_naam = trim(Request.Form("comment_naam"))
comm_naam = left(comm_naam, 45) 'Maximale lengt in mysql: 45
date_part = DatePart("d", date())
comm_datum = arrDagen(DatePart("w", date())) & " " & date_part & " " & arrMaandenLang(DatePart("m", date())) & ", om "
date_part = DatePart("h", time())
if (date_part < 10) then
date_part = "0" & date_part
end if
comm_datum = comm_datum & date_part & ":"
date_part = DatePart("n", time())
if (date_part < 10) then
date_part = "0" & date_part
end if
comm_datum = comm_datum & date_part
'comm_datum = & " " & DatePart("d", date()) & " " & arrMaandenLang(DatePart("m", date())) & ", om " & DatePart("h", time()) & ":" & DatePart("n", time())
comm_text = trim(Request.Form("comment_text"))
comm_maand = trim(Request.Form("comm_maand"))
comm_dag = trim(Request.Form("comm_dag"))
comm_code = trim(Request.Form("comment_code"))
comment_ip = request.servervariables ("remote_addr")
'Input veilig stellen
comm_text = Replace(comm_text, ">", ">")
comm_text = Replace(comm_text, "<", "<")
if (comm_naam <> "" AND comm_text <> "" ) then
objRS.CursorLocation = adUseServer
objRS.CursorType = adOpenKeyset
objRS.LockType = adLockOptimistic
objRS.Open "tblverjaardagcomment", objConn, , , adCmdTable
objRS.AddNew
objRS("comment_naam") = comm_naam
objRS("comment_date") = comm_datum
objRS("comment_text") = comm_text
objRS("comment_ip") = comment_ip
objRS("comment_dag") = comm_dag
objRS("comment_maand") = comm_maand
if (comm_code = "vier") then
'Code correct
objRS.Update
objRS.Close
response.Redirect ("Verjaardag_comment.asp?vDag=" & comm_dag & "&vMaand=" & comm_maand)
response.Write ("Je wordt automatisch doorverbonde naar de correcte pagina. <br />Mocht dat toch niet gebeuren, kan je <a href='Verjaardag_comment.asp?vDag=" & comm_dag & "&vMaand=" & comm_maand & "'>deze link gebruiken</a>.")
else
response.Write ("De code was foutief ingegeven. Ga terug naar de vorige pagina en geef de correcte code in.<br />Tip: de correcte code is <b>vier</b> (in letters).")
end if
else
response.Write ("Er waren lege velden. Vul alle velden in, en probeer opnieuw.")
end if
else
response.Write ("Je komt rechstreeks op deze pagina. Endamagni!")
end if
%>
<!--#include file="includes/bottom.asp"-->