September 17, 200916 yr Ok I will start by saying I am a complete noob at this contact form thing, its probably something really simple that I am missing here so please dont start having a go Basically the problem is I used an example .ASP file to send the information to from my HTML form, the only thing I have changed in the .ASP file is the "mail_to" address which it said to do. However when I test the page and click "submit" on the form it simply opens up the .ASP file in the web browser?? Could someone please just point out where I am being a complete **** and correct me please? Here is the HTML code for the form <div id="form"> <div id="fields"> <form action="contactsend.asp" method="post" name="contactForm"> <label for="inputname">Name:</label> <input type="text" name="Name" /><br /> <label for="inputmail">Email:</label> <input type="text" name="email" /><br /> <label for="inputtelefon">Location:</label> <input type="text" name="web" /><br /> <label for="inputmessage">Message:</label> <textarea name="message" cols="28" rows="4"></textarea> <div id="send"> <input type="image" src="images/send.gif" value="submit" /> </div> </form> </div></div> Here is the .ASP file <% 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 = "djceev2@hotmail.co.uk" 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 %> Bit of help for the noob please?
September 18, 200916 yr Firstly, can your server run ASP? Try this code first. Save it as hello.asp, upload it and run it through your server. Should simply print 'Hello World' and nothing else. <% Response.Write "Hello World" %>
October 18, 200916 yr Author Firstly, can your server run ASP? Try this code first. Save it as hello.asp, upload it and run it through your server. Should simply print 'Hello World' and nothing else. <% Response.Write "Hello World" %> yes that worked. This is .txt page which appears when i click submit: any help on this? <% 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 = "djceev2@hotmail.co.uk" 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 %>
October 19, 200916 yr Hi, Is it possible to see this in action? What is the url of the contact html form? Mike
Create an account or sign in to comment