%@ Language = VBScript%> <% Option Explicit%> <% Response.Buffer = true%>
" Const conClosePara = "
" Const conLineBreak ="",4)
intPos = InStr(1,strOut,strEndLine & strEndLine)
loop
intPos = InStr(1,strOut,strEndLine)
'response.write(intPos & "
")
do while intPos >0
strOut=swap(intPos,strOut,"
",2)
intPos = InStr(1,strOut,strEndLine)
loop
'response.write(strOut)
'response.end
makeParagraphs=strOut
End Function
dim strUpdate
strUpdate= request("update") & ""
if strUpdate<>"" then
end if
dim strFieldName(50),intFieldType(50), intFieldSize(50)
dim strFieldName2(50),intFieldType2(50), intFieldSize2(50)
dim objField, intFieldCount,intFieldCount2,intCount
intFieldCount=0
sql = "Select * From " & strTableName
Call objRecordSet.Open( sql, objConnection, adOpenForwardOnly, adLockOptimistic, adCmdText)
for each objField in objRecordSet.Fields
intFieldCount=intFieldCount + 1
strFieldName(intFieldCount)=objField.Name
intFieldType(intFieldCount)=objField.Type
intFieldSize(intFieldCount)=objField.DefinedSize
next
objRecordSet.Close
dim intRecordId
intRecordId=request(strFieldName(1)) + 0
'response.write(Session("ThankYou"))
'response.end
if Session("ThankYou") <>"" then
response.redirect("../default.asp")
end if
if strUpdate="on" then 'update the database
Session("Thankyou")="on"
if intRecordId=0 then
sql="Select * From " & strTableName & " where " & strFieldName(4) & " = '" & request(strFieldName(4)) & "';"
Call objRecordSet.Open( sql, objConnection, adOpenForwardOnly, adLockOptimistic, adCmdText)
if objRecordSet.eof then
objRecordSet.AddNew
objRecordSet(strFieldName(4))=request(strFieldName(4))
objRecordSet.Update
end if
intRecordId=objRecordSet.Fields(strFieldName(1)).value
objRecordSet.Close
end if
sql = "Select * From " & strTableName & " where " & strFieldName(1) & "=" & intRecordId & ";"
'response.write(sql)
Call objRecordSet.Open( sql, objConnection, adOpenForwardOnly, adLockOptimistic, adCmdText)
for intCount=2 to intFieldCount-1 'last field is the active field.
'response.write(strFieldName(intCount))
if intFieldType(intCount)= 202 then ' text field
objRecordSet(strFieldName(intCount))=replaceQuotes(request(strFieldName(intCount)))
elseif intFieldType(intCount)=203 Or intFieldType(intCount)=202 then
objRecordSet(strFieldName(intCount))=makeParagraphs(request(strFieldName(intCount)))
elseif intFieldType(intCount)=11 then
objRecordSet(strFieldName(intCount))=(request(strFieldName(intCount))="on")
elseif intFieldType(intCount)=7 then
objRecordSet(strFieldName(intCount))=DateValue(request(strFieldName(intCount)))
else
objRecordSet(strFieldName(intCount))=request(strFieldName(intCount))
end if
next
objRecordSet.Update
dim strCustomerEmail
strCustomerEmail=objRecordSet("EmailAddress")
objRecordSet.Close
end if
'dim temp
'for temp = 1 to intFieldCount
' response.write(strFieldName(temp) & " " & intFieldType(temp) & "
")
'next
'response.end
%>
![]() |
|||
|
|||
| <% if session("Thankyou")<>"" then%>
Thank you for registering for our email service. <% dim strMailFrom, strMailTo, strSubject,strTest ' What address does the mail come from? The Box Office strMailFrom = Application("EmailAddress") ' Who gets this email? strMailTo = strCustomerEmail ' Subject of the submitted message that comes to you strSubject = "Registration for Door Community Auditorium email notices complete" dim strMessage strMessage = "Your name has been added to the email list for the Door Community Auditorium" strTest=strMessage dim objMessage if Application("Email") then Set objMessage = CreateObject("CDONTS.Newmail") objMessage.Subject = strSubject & " (" & intRecordId & ")" objMessage.From = strMailFrom objMessage.To = strMailTo objMessage.Body = strMessage objMessage.Send objMessage=nothing end if else%>Register for Email Announcements from the Door Community Auditorium <% end if%> |