PDA

View Full Version : Syntax Error?



BestOnline
20 Jun 2006, 12:32 PM
Howdy guys,
I am a web designer for Best Online Results. I am right outa highschool and I know HTML very well but I am new to ASP. I am creating a forum that when completed will send a email to the appropiate email giving them the information that was filled out. I will post the code and the problem. here is a breif statement on what I am confused about. I have a selection of 6 check boxes and I want to output in the mail what has been selected. Here is the website, I have not messed with the alignment or anything I just got something up there to test it. www.houstonrealestateira.com/contactus.asp

It directs to test.asp.

Here is the code, I will underline the problem.


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<%
Dim strEmail, strFirstName, strLastName, strAddress, strState, strZip, strPhone, optHearList, strHearOther, optCurrent, strComments, mail, reply, objMail, strPrimList, strRadioGet, strMoney, strInterest, strNewsletter, strProgram
strEmail = Request.Form("ne_Email")
strFirstName = Request.Form("ne_FirstName")
strLastName = Request.Form("ne_LastName")
strAddress = Request.Form("ne_Address")
strState = Request.Form("ne_State")
strZip = Request.Form("ne_Zip")
optHearList = Request.Form("ne_HearList").Item
strPhone = Request.Form("ne_Phone")
strHearOther = Request.Form("ne_Other")
'-- optCurrent = request.form("new_CurrentList") --
strRadioGet = Request.Form( "ne_CurrentList" )
strPrimList = If InStr(Request.Form("ne_PrimList"), "1") > 0) then response.write("I am just gathering information<BR>") if InStr(Request.Form("ne_PrimList"), "2") > 0) then response.write("I already have a self directed IRA custodian but need checkbook control through a Self Directed IRA, LLC?<BR>") if InStr(Request.Form("ne_PrimList"),"3") > 0) then response.write("I have an investment in mind or transaction pending<BR>") if InStr(Request.Form("ne_PrimList"),"4") > 0) then response.write("I am interested in finding real estate to purchase with my self directed IRA<BR>") if InStr(Request.Form("ne_PrimList"),"5") > 0) then response.write("I am interested in purchasing an E-Business/Conventional Business/Franchise with my IRA<BR>") if InStr(Request.Form("ne_PrimList"),"6") > 0) then response.write("I want to purchase a property I can live in - Dream Home, Vacation Condo<BR>") strComments = Request.Form("ne_Comments")
strMoney = Request.Form("ne_Money").Item
strInterest = Request.Form("ne_interest").Item
strNewsletter = Request.Form("new_Newsletter")
strProgram = Request.Form("new_Program")
strComments = Request.Form("new_Comments")

mail = "robert@bestonlineresults.com"
reply = request.form("Email")
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = reply
objMail.Subject = "Testing."
objMail.BodyFormat=0
objMail.MailFormat=0
objMail.To = mail
objMail.TextBody = "FirstName: " & strFirstName & vbCrLf & _
"LastName: " & strLastName & vbCrLf & _
"Email: " & strEmail & vbCrLf & _
"Address: " & strAddress & vbCrLf & _
"State: " & strState & vbCrLf & _
"Zip Code: " & strZip & vbCrLf & _
"Phone: " & strPhone & vbCrLf & _
"How did you hear about us: " & optHearList & vbCrLf & _
"Other: " & strHearOther & vbCrLf & _
"Current Objective: " & strRadioGet & vbCrLf & _
"Primary Reasons 1: " & strPrimeList & vbCrLf & _
"Money: " & strMoney & vbCrLf & _
"Intrests: " & strIntrests & vbCrLf & _
"Want Newsletter?: " & strNewsletter & vbCrLf & _
"More information on Affilate Program?: " & strProgram & vbCrLf & _
"Comments: " & vbCrLf & strComments
objMail.Send
Set objMail = nothing
%>

Here is what I get from the server.


Microsoft VBScript compilation error '800a03ea' Syntax error

/test.asp, line 16

strPrimList = If InStr(Request.Form("ne_PrimList"), "1") > 0) then response.write("I am just gathering information<BR>") if InStr(Request.Form("ne_PrimList"), "2") > 0) then response.write("I already have a self directed IRA custodian but need checkbook control through a Self Directed IRA, LLC?<BR>") if InStr(Request.Form("ne_PrimList"),"3") > 0) then response.write("I have an investment in mind or transaction pending<BR>") if InStr(Request.Form("ne_PrimList"),"4") > 0) then response.write("I am interested in finding real estate to purchase with my self directed IRA<BR>") if InStr(Request.Form("ne_PrimList"),"5") > 0) then response.write("I am interested in purchasing an E-Business/Conventional Business/Franchise with my IRA<BR>") if InStr(Request.Form("ne_PrimList"),"6") > 0) then response.write("I want to purchase a property I can live in - Dream Home, Vacation Condo<BR>")
---------------^



Thanks. I am trying to get this up soon for the client. Also maybe some feedback on the site layout and graphics and stuff would be nice. www.houstonrealestateira.com.

Thanks again,
-robert@bestonlineresults.com

*EDIT* I forgot to add that there is a contact form on the site now, but it is not what the client wants. He wants to have all the fancy check boxes and all that jazz. Just incase yall got confused.

DanLatimer
20 Jun 2006, 03:02 PM
I don't know ASP.net but it looks like your if statement might need parentheses, thats what the arrow looks like it is pointing to. syntax errors are generally easy, bc you can look up the syntax online.