OttoBott
07-12-2007, 04:12 AM
Hi. I'm (obviously) a pretty big newb when it comes to ASP. I've had reasonable success with PHP but this is the first Window's server I've had to work on so I've been trying to get myself as familiar with ASP as possible.
Anyway, I've got this registration form (http://www.casaforkidsofet.org/register-champaign.html) working correctly when I wanted to make the three final boxes required. Initially I thought I was successful in making Name, Phone, and E-mail required but then I realized that regardless of what I put in, it came back as an invalid submission. The ASP script I'm using is
<%
DIM strreal_name, strphone_number, stre_mail
strreal_name = Request.Form("Real Name")
strphone_number = Request.Form("Phone Number")
stre_mail = Request.Form("E-Mail")
IF strreal_name <> "" AND strphone_number <> "" AND stre_mail <> "" THEN
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "CASA Website Registration"
Mailer.FromAddress= "registration@casaforkidsofet.org"
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient "Georgia Harris", "z.herring@gmail.com"
Mailer.AddExtraHeader "X-MimeOLE:Produced yourdomain.com"
Mailer.Subject = "Form Submission"
strMsgHeader = "Form information follows" & vbCrLf
for each qryItem in Request.Form
strMsgInfo = strMsgInfo & qryItem & " - " & request.Form(qryItem) & vbCrLf
next
strMsgFooter = vbCrLf & "End of form information"
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.SendMail then
Response.Redirect("ok.htm?" & EmailFrom)
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
set Mailer = Nothing
ELSE
Response.Write "<p>Please click back on your browser and complete the following fields:</p>"
IF strreal_name <> "" THEN
ELSE
Response.Write "<b>• Name</b><br>"
END IF
IF strphone_number <> "" THEN
ELSE
Response.Write "<b>• Phone Number</b><br>"
END IF
IF stre_mail <> "" THEN
ELSE
Response.Write "<b>• E-Mail</b><br>"
END IF
END IF
%>
I honestly can't find what I'm doing wrong. I've googled this problem for hours now, gone back over and over again all of the ASP scripts I was referencing and I'm apparently missing a pretty big something. Any assistance would be greatly appreciated.
Thanks for your time and (hopefully) your help.
:D
Anyway, I've got this registration form (http://www.casaforkidsofet.org/register-champaign.html) working correctly when I wanted to make the three final boxes required. Initially I thought I was successful in making Name, Phone, and E-mail required but then I realized that regardless of what I put in, it came back as an invalid submission. The ASP script I'm using is
<%
DIM strreal_name, strphone_number, stre_mail
strreal_name = Request.Form("Real Name")
strphone_number = Request.Form("Phone Number")
stre_mail = Request.Form("E-Mail")
IF strreal_name <> "" AND strphone_number <> "" AND stre_mail <> "" THEN
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "CASA Website Registration"
Mailer.FromAddress= "registration@casaforkidsofet.org"
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient "Georgia Harris", "z.herring@gmail.com"
Mailer.AddExtraHeader "X-MimeOLE:Produced yourdomain.com"
Mailer.Subject = "Form Submission"
strMsgHeader = "Form information follows" & vbCrLf
for each qryItem in Request.Form
strMsgInfo = strMsgInfo & qryItem & " - " & request.Form(qryItem) & vbCrLf
next
strMsgFooter = vbCrLf & "End of form information"
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.SendMail then
Response.Redirect("ok.htm?" & EmailFrom)
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
set Mailer = Nothing
ELSE
Response.Write "<p>Please click back on your browser and complete the following fields:</p>"
IF strreal_name <> "" THEN
ELSE
Response.Write "<b>• Name</b><br>"
END IF
IF strphone_number <> "" THEN
ELSE
Response.Write "<b>• Phone Number</b><br>"
END IF
IF stre_mail <> "" THEN
ELSE
Response.Write "<b>• E-Mail</b><br>"
END IF
END IF
%>
I honestly can't find what I'm doing wrong. I've googled this problem for hours now, gone back over and over again all of the ASP scripts I was referencing and I'm apparently missing a pretty big something. Any assistance would be greatly appreciated.
Thanks for your time and (hopefully) your help.
:D