CDONT Form needed

General software, Operating Systems, and Programming discussion.
Everything from software questions, OSes, simple HTML to scripting languages, Perl, PHP, Python, MySQL, VB, C++ etc.
Post Reply
User avatar
shadrach
Regular Member
Posts: 338
Joined: Thu Nov 30, 2000 12:00 am
Location: Chicago

CDONT Form needed

Post by shadrach »

Hello all....I was a regular on the Hardware forum here, so I figured I'd give this a shot...

I need to incorporate a CDONT Form into a website, and honestly I've been out of the HTML coding loop for a few years. I used to make sites with Notepad, but that's not going to cut it anymore :)

I'm using Dreamweaver 4.0 and tring to add a form to an existing website. Our host says we are running on a Windows box, so I should use a CDONT script.
Intel P4 2.8 800FSB / Asus P4P800SE / Corsair 1024MB PC3200 / Antec Sonata / TruePower 380w
Asus GeForce4 Ti4200 / Seagate 200GB SATA / WD 200GB IDE / LiteOn 4x DVD-RW / Windows XP Pro SP2
User avatar
TonyT
SG VIP
Posts: 10356
Joined: Fri Jan 28, 2000 12:00 am
Location: Fairfax, VA

Post by TonyT »

No one has any right to force data on you
and command you to believe it or else.
If it is not true for you, it isn't true.

LRH
dkittell

CDONTS Form

Post by dkittell »

This is a very basic contact page using CDONTS

---Form Page---

Code: Select all

<FORM ACTION="contact1.asp" METHOD="POST">
<input type="hidden" name="To" value="email@address.com">
<INPUT TYPE="HIDDEN" NAME="Sub" VALUE="Contact Form"> 
<table>
<tr><td>Name:</td><td><input name=name size="20"></td></tr>
<tr><td>E-mail address:</td><td><input name=email size="20"> or <input type=radio name=email value="unknownemail@address.com"> None</td></tr>
<tr><td valign="top">Comments:</td><td><textarea rows=4 cols=30 name=Comments wrap=hard></textarea></td></tr>
</table><input type="submit" value="submit" class="white"><input type="reset" class="white">
</form>
 
---Process Page---

Code: Select all

<%@ LANGUAGE="VBSCRIPT" %>
<%
Dim objMail, strBody, strTo, strSub, strname, stremail, strComments

strTo = Trim(Request.Form("To"))
strSub = Trim(Request.Form("Sub"))
strname = Trim(Request.Form("name"))
stremail = Trim(Request.Form("email"))
strComments = Trim(Request.Form("Comments"))


strBody = "Name: " & strname
strBody = strBody & vbCrLf & "Email: " & stremail
strBody = strBody & vbCrLf & "Comments: " & strComments

Set objMail = Server.CreateObject("CDONTS.NewMail")

objMail.From = stremail
objMail.To = strTo
objMail.Subject = strSub
objMail.Body = strBody
objMail.Send 
Set objMail = Nothing
%>
<html>
<head>

<title>Contact</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000ff" vlink="#ff0000">
<div align="center"><font size="+2">Thank you <% = strname%>, for filling out the <% = strSub%></font></div>
<p><b><u>The following has been sent:</u></b>
<table border="1" bordercolor="#000000" cellpadding="2" cellspacing="0">
<tr>
<td>
<table>
<tr><td><b>Name:</b></td><td><% = strname%></td></tr>
<tr><td><b>E-mail address:</b></td><td><% = stremail%></td></tr>
<tr><td valign="top"><b>Comments:</b></td><td><% = strComments%></td></tr>
</table></td>
</tr>
</table></td></tr>
</table>
</body>
</html>
 
Post Reply