Petrolhead
Technical User
- Mar 13, 2009
- 27
Hi There,
When my contact page runs this script I get the following error:
Error Type:
Sun ONE ASP VBScript compilation (0x800A03F6)
Expected 'End'
/thomas-irvine.com/scripts/contact.asp, line 53, column 51
I think I have closed all the ifs unless the elseifs need closing too.
Can anyone help?
When my contact page runs this script I get the following error:
Error Type:
Sun ONE ASP VBScript compilation (0x800A03F6)
Expected 'End'
/thomas-irvine.com/scripts/contact.asp, line 53, column 51
I think I have closed all the ifs unless the elseifs need closing too.
Can anyone help?
Code:
<%
' declare variables
Dim EmailTo
Dim Subject
Dim Name
Dim Subject
Dim EMailAddress
Dim Message
' get posted data into variables
EmailTo = "tirvine24@gmail.com"
Subject = Trim(Request.Form("Subject"))
Name = Trim(Request.Form("Name"))
EMailAddress = Trim(Request.Form("Email"))
Message = Trim(Request.Form("Message"))
' validation
Dim validationOK
If (Trim(Name)="") Then
validationOK=false
ElseIf (Trim(Subject)="") Then
validationOK=false
ElseIf (Trim(Email)="") Then
validationOK=false
ElseIf (Trim(Message)="") Then
validationOK=false
Else validaionOK=true
EndIf
If (validationOK=false) Then Response.Redirect("./error.html")
EndIf
' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Subject: " & Subject & VbCrLf
Body = Body & "E-MailAddress: " & E-MailAddress & VbCrLf
Body = Body & "Message: " & Message & VbCrLf
' send email
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail")
mail.To = EmailTo
mail.Subject = Subject
mail.Body = Body
mail.Send
' redirect to success page
Response.Redirect("./contact-info-thank-you.htm")
%>