iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-05-2006, 06:20 PM
WebProWorld Pro
 
Join Date: Jul 2003
Location: Naples, FL
Posts: 121
brianzajac RepRank 0
Default Need to Build a Contact Form

Hello programming 'gods' ;)

First off, I've never planned on being a programmer, and here is why:

I'm trying to make a contact form with ASPEmail. The current server I am on does not support CDONTS & CDOSYS since there's a major glitch in the Win2003 SP1 software.

First, here is where the contact form is:
http://eyeimagination.us/marblegrani...contact_us.asp

It references to the form below. It works, but there's two major things wrong with it:

1. The error code does not work. That is why I'm using a form validation system.

2. I want to be able to add "telephone", "Street Address", and "City, State & Zip" fields.

I AM BEGGING! PLEASE HELP A DESIGNER OUT! Thank you in advance.


Code:
<%
   'Brian, this is the part where it requests the values from the form...notice the names match the 
'field names from the form page
Name = Request.Form("Name")
Telephone = Request.Form("Telephone")
StreetAddress = Request.Form("StreetAddress")
CityStateZip = Request.Form("CityStateZip")
Email = Request.Form("Email")
Inquiry = Request.Form("Inquiry")

'Brian, new form types you asked for dropdown, radio and checkbox, notice the treatment of the
'checkbox...its the only kind that acts different.  on the html page I set the checked value to mean
'Yes and in this page I'm saying if it isn't equal to yes then it must be no.  Because an unchecked
'box will come thru as blank.

'Brian, this builds the body of the email
body = "Name:  " & Name & "
"
body = body & "Telephone:  " & Telephone & "
"
body = body & "Street Address:  " & StreetAddress & "
"
body = body & "City,State and Zip:  " & CityStateZip & "
"
body = body & "Email:  " & Email & "
"
body = body & "Inquiry:  " & Inquiry & "
"
   
   Set Mail = Server.CreateObject("Persits.MailSender")
   ' enter valid SMTP host
   Mail.Host = "mail.cybercastmedia.com"
   


   Mail.From = Request("Email") ' From address
   Mail.FromName = Request("Name")
   Mail.AddAddress "brian.zajac@3das.com", "Brian Zajac" 

   ' message subject
   Mail.Subject = "Inquiry From the Marble Granite Direct Website - marblegranitedirect.com"
   ' message body
    Mail.Body = Request("Inquiry")


strErr = ""
   bSuccess = False
   On Error Resume Next ' catch errors
   Mail.Send ' send message
   If Err <> 0 Then ' error occurred
      strErr = Err.Description
   else
      bSuccess = True
   End If
%>

<HTML>

<BODY BGCOLOR="#FFFFFF">
<% If strErr <> "" Then %>
<h3>Error occurred: <% = strErr %>.  Please click your browser's back button and correctly fill out our form.  Thank you.
<% End If %>
<% If bSuccess Then %>
Thank you for filling out our form <% = Request("Email") %>.  Click HERE to return to our home page.
<% End If %>
</body>
</html>
__________________
Brian Zajac
EyeMagination
http://www.eyemagination.us - Naples Florida Web Design & Marketing
info@eyemagination.us
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 12:05 AM.



Search Engine Optimization by vBSEO 3.3.0