%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
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
%><%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<%
' 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_Conn_STRING
MM_editCmd.CommandText = "INSERT INTO tblsweeps (FirstName, LastName, Address1, Address2, City, StateID, Zip, Email, Phone, DOB, optin, EntryDate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 201, 1, 65535, Request.Form("FirstName")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 201, 1, 65535, Request.Form("LastName")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 201, 1, 65535, Request.Form("Address1")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 201, 1, 65535, Request.Form("Address2")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 201, 1, -1, Request.Form("City")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 201, 1, -1, Request.Form("stateID")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 201, 1, -1, Request.Form("Zip")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 201, 1, -1, Request.Form("Email")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param9", 201, 1, 65535, Request.Form("Phone")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param10", 135, 1, -1, MM_IIF(Request.Form("DOB"), Request.Form("DOB"), null)) ' adDBTimeStamp
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param11", 5, 1, -1, MM_IIF(Request.Form("optin"), 1, 0)) ' adDouble
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param12", 135, 1, -1, MM_IIF(Request.Form("EntryDate"), Request.Form("EntryDate"), null)) ' adDBTimeStamp
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "thanks.html"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
Gillette "Triple Protection" Deodorant Pit Crew Classic