Hi there,
This is the asp contact form source code I need to setup a contact form
Trouble is when I click on the submit button I get a page full of code instead of the error.html page appearing advising user to go back and complete required fields on my form
Where am I going wrong?
Thanks
This is the asp contact form source code I need to setup a contact form
Trouble is when I click on the submit button I get a page full of code instead of the error.html page appearing advising user to go back and complete required fields on my form
Where am I going wrong?
Thanks
<%
Dim error
error = 0
For Each f In Request.Form
If Request.Form(f) = "" Then
error = 1
End If
Next
If error=1 Then
response.redirect "error.html"
Else
Dim f, emsg, mail_to, r, o, c, other
mail_to = "[email protected]"
fline = "_______________________________________________________________________"& vbNewLine
hline = vbNewLine & "_____________________________________"& vbNewLine
emsg = ""
For Each f In Request.Form
If mid(f,1,1)<>"S" = True Then 'do not save if input name starts with S
emsg = emsg & f & " = " & Trim(Request.Form(f)) & hline
End If
Next
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = Request("Email Address")
objNewMail.Subject = "Message from contact page (version: 1.0)"
objNewMail.To = mail_to
objNewMail.Body = emsg & fline
objNewMail.Send
Set objNewMail = Nothing
response.redirect "thankyou.html"
End if
%>