Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ASP Contact Form Help!

Featured Replies

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?

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"
%>

  • 1 month later...
  • 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

%>

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.