Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

asp contact form

Thread Tools
 
Search this Thread
 
Old 25 July 2007, 12:44 PM
  #1  
ChristianR
Scooby Regular
Thread Starter
iTrader: (1)
 
ChristianR's Avatar
 
Join Date: May 2001
Location: Europe
Posts: 6,329
Likes: 0
Received 1 Like on 1 Post
Default asp contact form

Anyone have an asp contact form script that users serverside to send email?

Also need it to accept a variable, i.e. contactform.asp?ABC123

on the contact form under course it would have filled in and not editable to the user: ABC123

Thanks.
Old 25 July 2007, 10:03 PM
  #2  
ryn004
Scooby Regular
 
ryn004's Avatar
 
Join Date: Apr 2005
Location: Malta
Posts: 1,084
Likes: 0
Received 0 Likes on 0 Posts
Default

To hide content use: <input type="hidden" name="MyHiddenText" value="aBC123"> instead of input type="text" name="MyHiddenText" value="aBC123">
Old 30 July 2007, 07:45 PM
  #3  
ChristianR
Scooby Regular
Thread Starter
iTrader: (1)
 
ChristianR's Avatar
 
Join Date: May 2001
Location: Europe
Posts: 6,329
Likes: 0
Received 1 Like on 1 Post
Default

ok but how do I call the hiddenname? as depending on what course page ABC123 will be different
Old 30 July 2007, 08:36 PM
  #4  
ryn004
Scooby Regular
 
ryn004's Avatar
 
Join Date: Apr 2005
Location: Malta
Posts: 1,084
Likes: 0
Received 0 Likes on 0 Posts
Default

You call it like any other field. That is:

hiddenfield = request.form("MyHiddenText")

If you don't manage pm me and I'll do it for you.
Old 31 July 2007, 10:52 AM
  #5  
InvisibleMan
Scooby Regular
 
InvisibleMan's Avatar
 
Join Date: May 2001
Location: .
Posts: 12,583
Received 0 Likes on 0 Posts
Default

why hidden field whats it for?
Old 31 July 2007, 11:25 PM
  #6  
ryn004
Scooby Regular
 
ryn004's Avatar
 
Join Date: Apr 2005
Location: Malta
Posts: 1,084
Likes: 0
Received 0 Likes on 0 Posts
Default

"hiddenfiield" is a variable, you name it whatever you like.
Old 04 August 2007, 12:37 PM
  #7  
pimmo2000
Scooby Regular
iTrader: (6)
 
pimmo2000's Avatar
 
Join Date: Sep 2004
Location: On a small Island near France
Posts: 14,660
Received 4 Likes on 4 Posts
Default

Web Form: contact.htm


Obviously change the name and contact information if you like

<form method="POST" action="contact.asp">
Fields marked (*) are required

<p>Name:* <br>
<input type="text" name="Name">
<p>Address:<br>
<input type="text" name="Address">
<p>Telephone:<br>
<input type="text" name="Telephone">
<p><input type="submit" name="submit" value="Submit">
</form>
<p>


ASP Script: contact.asp



' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Address
Dim Telephone

' get posted data into variables
EmailFrom = "test@scoobynet.com"
EmailTo = "owner@yoursite.com"
Subject = "Web site feedback"
Name = Trim(Request.Form("Name"))
Address = Trim(Request.Form("Address"))
Telephone = Trim(Request.Form("Telephone"))

' validation
Dim validationOK
validationOK=true
If (Trim(Name)="") Then validationOK=false
If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom)

' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Address: " & Address & VbCrLf
Body = Body & "Telephone: " & Telephone & VbCrLf

' send email
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail")
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send

' redirect to success page
Response.Redirect("ok.htm?" & EmailFrom)
%>
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Darrell@Scoobyworx
Trader Announcements
26
30 January 2024 01:27 PM
KAS35RSTI
Subaru
27
04 November 2021 07:12 PM
Frizzle-Dee
Essex Subaru Owners Club
13
09 March 2019 07:35 PM
Frizzle-Dee
Essex Subaru Owners Club
13
01 December 2015 09:37 AM
leg200
Wanted
7
23 October 2015 01:30 PM



Quick Reply: asp contact form



All times are GMT +1. The time now is 04:19 AM.