Link to home
Start Free TrialLog in
Avatar of ScottRAnderson1
ScottRAnderson1

asked on

Dreamweaver Form Submission

Hi,
I have a site set up in Dreamweaver and I would like to setup a form that submits information to an email address. The site is HTML and I have the form set up but need the code to direct the information to the email. I use 1and1 as a host.
The page and form is at:http://www.kamrowcontractors.com/estimate.html
  I need to form to go to (email removed by Moderator)

Let me know if you need anything else .
Thanks for your help.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/kamrowHomeNoTab.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Kamrow Contractors Estimate Form</title>
<!-- InstanceEndEditable -->
<link href="kam2colliqtemp.css" rel="stylesheet" type="text/css" /><!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColLiqLtHdr #sidebar1 { padding-top: 30px; }
.twoColLiqLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
<style type="text/css">
<!--
.boldsubheadskam {
	font-size: 16px;
	font-family: Arial, Helvetica, sans-serif;
	color: #000;
}
#topnavkam {
	margin-top: 0px;
	margin-bottom: 0px;
	height: 40px;
	background-color: #999;
}
#apDiv1 {
	position:absolute;
	width:279px;
	height:115px;
	z-index:1;
	left: 734px;
	top: 16px;
}
#apDiv2 {
	position:absolute;
	width:352px;
	height:133px;
	z-index:1;
	left: 723px;
	top: 11px;
}
.twoColLiqLtHdr #container #header #phone number h5 strong {
	color: #9C0500;
}
.twoColLiqLtHdr #container #header #phone number h5 {
	color: #9C0500;
}
.twoColLiqLtHdr #container #header #phone number #interior title h5 {
	color: #000;
}
.twoColLiqLtHdr #container #header #phone number #interior title h5 {
	color: #000;
}
.twoColLiqLtHdr #container #sidebar1 .boldsubheadskam .interiortitle a #estimate21 {
	color: #9C0500;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<!-- InstanceBeginEditable name="head" -->
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
</head>
 
<body class="twoColLiqLtHdr" onload="MM_preloadImages('Kamrowimages501/buttons/contactdown.jpg','Kamrowimages501/buttons/showdown.jpg','Kamrowimages501/buttons/servicesdown.jpg','Kamrowimages501/buttons/guardown.jpg','Kamrowimages501/buttons/paintbrushbutton2.jpg','Kamrowimages501/buttons/homedown.jpg','Kamrowimages501/buttons/aboutdown.jpg','Kamrowimages501/buttons/mba_member_logoa.jpg','Kamrowimages501/buttons/paradelogoc.jpg')">
<div align="right"></div>
<div id="container">
  <div id="header">
    <h1 align="right"><a href="http://www.mbaonline.org/default.htm" target="_blank" onmouseover="MM_swapImage('MBA Logo','','Kamrowimages501/buttons/mba_member_logoa.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="Kamrowimages501/buttons/mba_member_logo.jpg" alt="Kamrow Contractors is a member of the Metropolitan BUilders Association or Greater Milwaukee" name="MBA Logo" width="89" height="117" hspace="20" vspace="10" border="0" align="middle" id="MBA Logo" /></a></h1>
  </div>
  <div align="center">
    <table border="0" align="center" cellpadding="0" cellspacing="0" class="clearfloat">
      <tr>
        <td><a href="index.html" target="_top" onClick="MM_nbGroup('down','group1','home','',1)" onMouseOver="MM_nbGroup('over','home','Kamrowimages501/buttons/homedown.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img name="home" src="Kamrowimages501/buttons/homeup.jpg" border="0" alt="Kamrow Contractors interior and exterior painting home page" onLoad="" /></a></td>
        <td><a href="contact.html" target="_top" onclick="MM_nbGroup('down','group1','contactup','',1)" onmouseover="MM_nbGroup('over','contactup','Kamrowimages501/buttons/contactdown.jpg','',1)" onmouseout="MM_nbGroup('out')"><img src="Kamrowimages501/buttons/contactup.jpg" alt="Kamrow Contractors Interior and Exterior Painting Services in Sussex, Waukesha and Milwaukee" name="contactup" width="164" height="40" border="0" id="contactup" onload="" /></a></td>
        <td><a href="showroom.html" target="_top" onclick="MM_nbGroup('down','group1','showup','',1)" onmouseover="MM_nbGroup('over','showup','Kamrowimages501/buttons/showdown.jpg','',1)" onmouseout="MM_nbGroup('out')"><img src="Kamrowimages501/buttons/showup.jpg" alt="Kamrow Contractors Interior and Exterior Painting Services in Sussex, Waukesha and Milwaukee" name="showup" width="163" height="40" border="0" id="showup" onload="" /></a></td>
        <td><a href="about.html" target="_top" onClick="MM_nbGroup('down','group1','about','',1)" onMouseOver="MM_nbGroup('over','about','Kamrowimages501/buttons/aboutdown.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img name="about" src="Kamrowimages501/buttons/aboutup.jpg" border="0" alt="About Kamrow Contractors interior and exterior painting" onLoad="" /></a></td>
        <td><a href="services.html" target="_top" onclick="MM_nbGroup('down','group1','servicesup','',1)" onmouseover="MM_nbGroup('over','servicesup','Kamrowimages501/buttons/servicesdown.jpg','',1)" onmouseout="MM_nbGroup('out')"><img src="Kamrowimages501/buttons/servicesup.jpg" alt="Kamrow Contractors Interior and Exterior Painting Services in Sussex, Waukesha and Milwaukee" name="servicesup" width="163" height="40" border="0" id="servicesup" onload="" /></a></td>
        <td><a href="guarantee.html" target="_top" onclick="MM_nbGroup('down','group1','guarup','',1)" onmouseover="MM_nbGroup('over','guarup','Kamrowimages501/buttons/guardown.jpg','',1)" onmouseout="MM_nbGroup('out')"><img src="Kamrowimages501/buttons/guarup.jpg" alt="Kamrow Contractors Interior and Exterior Painting Services in Sussex, Waukesha and Milwaukee" name="guarup" width="165" height="40" border="0" id="guarup" onload="" /></a></td>
      </tr>
    </table>
  </div>
  <div id="sidebar1"> 
    <div align="center" class="boldsubheadskam">
      <h4><span class="interiortitle"><strong>Need an Estimate?<br />
        Click here to get<br />
        your project started</strong></span><strong><br />
      </strong><span class="body"><strong class="interiortitle"><a href="estimate.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('estimate21','','Kamrowimages501/buttons/paintbrushbutton2.jpg',1)"><img src="Kamrowimages501/buttons/paintbrushbutton.jpg" alt="Kamrow Contractors Interior and Exterior Painting Services in Sussex, Waukesha and Milwaukee" name="estimate21" width="179" height="76" vspace="10" border="0" align="middle" id="estimate21" /></a></strong></span></h4>
      <h4><strong class="interiortitle">or call Kamrow<br />
        Contractors at:<br />
        <em>262-893-8796</em>.</strong> </h4>
      <p><a href="http://www.mbaonline.org/events/parade/paradeCurrent/paradeCurrent_home.htm" target="_blank" onmouseover="MM_swapImage('Parade of Homes Logo','','Kamrowimages501/buttons/paradelogoc.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="Kamrowimages501/buttons/paradelogob.jpg" alt="Kamrow Contractors has 5 years in the Parade of Homes of Greater Milwaukee" name="Parade of Homes Logo" width="125" height="166" border="0" id="Parade of Homes Logo" /></a><br />
      </p>
</div>
    <h2 align="center">
  <!-- end #sidebar1 --></h2></div>
  <!-- InstanceBeginEditable name="EditRegion3" -->
  <div id="mainContent">
    <h3>ESTIMATE INFORMATION<br />
    </h3>
    <FORM METHOD=POST ENCTYPE="text/plain" 
    ACTION="mailto:sranderson@wi.rr.com">
<form id="form1" name="form1" method="post" action="">
  <p align="left">
    <input type="text" name="Name" id="Name"tabindex="1" />
    <label for="Name2">Name</label>
  </p>
  <p align="left"> 
    <input name="Company Name" type="text" id="Company Name"tabindex="2" />
    Company Name</p>
</form>
    <form id="form2" name="form2" method="post" action="">
      <p align="left">
        <input type="text" name="Address" id="Address" tabindex="3" />
        <label for="Address">Address</label>	
      </p>
      <p align="left">
        <input type="text" name="City" id="City" tabindex="4" />
        <label for="City">City</label>
      </p>
      <p align="left">
        <input type="text" name="State" id="State" tabindex="5" />
      State</p>
      <p align="left">
  <input type="text" name="Zip Code" id="Zip Code" tabindex="6" />
        <label for="Zip Code">Zip Code</label>
      </p>
      <p align="left">
        <input type="text" name="Phone Number" id="Phone Number" tabindex="7" />
        <label for="Phone Number">Phone Number</label>
      </p>
      <p align="left">
        <input type="text" name="email" id="email" tabindex="8" />
        <label for="email">email</label>
      </p>
      <p align="left">
        <select name="Project Style" id="Project Style" tabindex="9">
          <option value="1">Interior Painting House - existing</option>
          <option value="2">Interior Painting House - new construction</option>
          <option value="3">Exterior Painting House - existing</option>
          <option value="4">Exterior Painting - new construction</option>
          <option value="5">Interior Painting Business - existing</option>
          <option value="6">Interior Painting Business - new construction</option>
          <option value="7">Exterior Painting Business - existing</option>
          <option value="8">Exterior Painting Business - new construction</option>
          <option value="9">Enameled Columns</option>
          <option value="10">Epoxy Garage Floors</option>
          <option value="11">Wood Finishing/Staining</option>
        </select>
        <label for="Project Style">What type of  project?</label>
      </p>
      <p align="left">
        <textarea name="Project Description" id="Project Description" cols="45" rows="5" tabindex="12"></textarea>
        Project Description
        <label for="Project Description"><br />
        </label>
      </p>
      <p align="left">
        <select name="Start Date" id="Start Date" tabindex="11">
          <option value="1">Immediately</option>
          <option value="2">1 month</option>
          <option value="3">3 months</option>
          <option value="4">6 months</option>
          <option value="5">1 year</option>
        </select>
        <label for="Start Date">Start Date</label>
      </p>
      <p align="left">
        <input type="text" name="How did you hear about Kamrow Contractors?" id="How did you hear about Kamrow Contractors?" tabindex="13" />
        <label for="How did you hear about Kamrow Contractors?">How did you hear about Kamrow Contractors?</label>
      </p>
      <p align="left">&nbsp;</p>
      <p align="center">
        <input type="submit" name="Submit" id="Submit" value="Submit" tabindex="16" />
        <label for="Submit">Submit to Kamrow Contractors</label>
      </p>
      <p align="center">&nbsp;</p>
      <div align="center"><p align="left">        <span id="sprytextfield1"><span class="textfieldRequiredMsg">A value is required.</span></span></p>
<p align="left">&nbsp;</p>
<div align="left"><div align="center"><p>&nbsp; </p>
      <p>&nbsp;</p>
    </div><</FORM>
    <div align="center"><div align="left"><div align="center"><h3><br />
    </h3>
<h1>&nbsp;</h1>
 
   <!-- end #mainContent -->
  </div></div></div></div>
  <div align="center"><script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
//-->
  </script>
  </div><!-- InstanceEndEditable -->
  <div align="center"><div align="left"><div align="center"><!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
  <br class="clearfloat" />
  <div id="footer">
    <p>©2009 Kamrow Contractors, LLC.</p>
    <!-- end #footer -->
  </div>
<!-- end #container --></div></div></div></div>
</body>
<!-- InstanceEnd --></html>

Open in new window

Avatar of ChristoferDutz
ChristoferDutz
Flag of Germany image

Ok ... since your Service Provider is 1and1 and I could see its our german 1und1 or 1&1 I guess the same solution applies here. You have to set the action to the 1und1 formmailer script and set some invisible fields and name your visible fields to some special names. Here comes a code snippete showing you the details. If you are familiar with reading german texts, here comes the link:

http://hilfe-center.1und1.de/hosting/scripte_datenbanken/php/1.html
<form action="formmail.php" method="POST"> <input type="hidden" name="subject" value="Kontaktformular"> <input type="hidden" name="access" value="irregeheim"> <textarea name="Eingabe" cols="60" rows="20" wrap="PHYSICAL" id="Eingabe"></textarea> <input type="submit" value="Abschicken"> </form>

Open in new window

Following the guide on this english page (Just for Linux customers):
http://faq.1and1.com/scripting_languages_supported/formmail_explained/index.html

You have to get the Script from the following URL and place it in your "cgi-bin" directory:
http://nms-cgi.sourceforge.net/tfmail.tar.gz

You have to configure your script to use the correct subject and post to the right recipients. It is explained here:
http://faq.1and1.com/scripting_languages_supported/formmail_explained/4.html

Then you have to modify your html-page to post to this script (Only the action is set to : /cgi-bin/FormMail.pl)
<form id="form1" name="form1" method="post" action="/cgi-bin/FormMail.pl">
  <p align="left">
    <input type="Eingabe" name="Name" id="Name"tabindex="1" />
    <label for="Name2">Name</label>
  </p>
  <p align="left"> 
    <input name="Company Name" type="text" id="Company Name"tabindex="2" />
    Company Name</p>
</form>

Open in new window

Hi,
your host supports php so you need to setup you from to submit to a .php file e.g. <FORM METHOD="POST"   ACTION="mail.php">.
 I have some code for you that you can use as a base and fill in you own info. Also change your html so that you only have one form on the page and not multiple forms, put all the fields under the form that will post to the php file.

Hope this helps.
Regards

<?php
// multiple recipients
$to  = 'example@example.com'; . ', '; // note the comma
$to .= 'wez@example.com';
 
// subject
$subject = 'ESTIMATE INFORMATION';
 
// message
$message = '
<html>
<head>
  <title>ESTIMATE INFORMATION</title>
</head>
<body>
  <p>Here are the ESTIMATE INFORMATION!</p>
  <table>
    <tr>
      <td>Name</td><td>' . $HTTP_POST_VARS['Name'] . '</td>
    </tr>
    <tr>
      <td>Company Name</td><td>' . $HTTP_POST_VARS['Company Name'] . '</td>
    </tr>
    <tr>
      <td>Address</td><td>' . $HTTP_POST_VARS['Address'] . '</td>
    </tr>
    <tr>
      <td>City</td><td>' . $HTTP_POST_VARS['City'] . '</td>
    </tr>	
    <tr>
      <td>State</td><td>' . $HTTP_POST_VARS['State'] . '</td> 
    </tr>	
    <tr>
      <td>Zip Code</td>	  <td>' . $HTTP_POST_VARS['Zip Code'] . '</td>	  
    </tr>		
    <tr>
      <td>Phone Number</td>	  <td>' . $HTTP_POST_VARS['Phone Number'] . '</td>	  
    </tr>			
    <tr>
      <td>Email</td>	  <td>' . $HTTP_POST_VARS['Email'] . '</td>	  
    </tr>				
    <tr>
      <td>What type of project?</td>	<td>' . $HTTP_POST_VARS['Project Style'] . '</td>	    
    </tr>					
    <tr>
      <td>Project Description</td>	 <td>' . $HTTP_POST_VARS['Project Description'] . '</td>	    	  
    </tr>					
    <tr>
      <td>Start Date</td>	<td>' . $HTTP_POST_VARS['Start Date'] . '</td>	  
    </tr>			
    <tr>
      <td>How did you learn about us?</td><td>' . $HTTP_POST_VARS['How did you hear about Kamrow Contractors?'] . '</td>		  	  
    </tr>					
	
  </table>
  
</body>
</html>
';
 
// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder savva.andreas@gmail.com' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
 
// Mail it
mail($to, $subject, $message, $headers);
?>

Open in new window

Avatar of ScottRAnderson1
ScottRAnderson1

ASKER

Thanks for the reply. I'm new to this so it will be an hour or 2 before I get back to you.
ASKER CERTIFIED SOLUTION
Avatar of Glenn Abelson
Glenn Abelson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
glenn 1984,
Thanks for the link. I'm still learning this stuff so the earlier answers were a little beyond my capabilities. The software worked great. Once I learn this stuff I should be able to do it on my own. Thanks to everyone that answered.
Scott
You are welcome.
However, once I started using this I never went back to "doing it myself".
It was just too clean.
When I was going to do it myself, 1and1 had an instruction line that said I needed to edit the ssl. I didn't have this option. Would it have been an add on? I went to my web access area and it didn't match their instruction area.