Log in

View Full Version : HTML contact form



awg
08-04-2007, 04:17 PM
Hello guys!
Just wondering if any one can help me set up my contact form on the template i have just got. when some one fills out the form how do i get the form to send to my email address please?

Here is the HTML code on the contact page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script language="JavaScript" type="text/JavaScript">
<!--
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_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_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>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" style="height:100%;">
<tr>
<td style="width:100%; height:700px;"><table class="e3">
<tr>
<td class="rez"><table>
<tr><td class="rez1"></td></tr>
<tr><td class="rez2"></td></tr>
<tr><td class="rez3"></td></tr>
</table></td>
<td style="width:766px;"><table style="width:766px;">
<!--top-->
<tr>
<td class="top1"><table>
<tr>
<td class="top2"><a href="index.html">
<img alt="" src="images/logo.gif" width="200" height="63"></a></td>
<td><table class="top3">
<tr>
<td><a href="index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image1','','images/m1m.jpg',1)">
<img alt="" src="images/m1.jpg" name="image1" width="98" height="95"></a></td>
<td><a href="index-1.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image2','','images/m2m.jpg',2)">
<img alt="" src="images/m2.jpg" name="image2" width="74" height="95"></a></td>
<td><a href="index-2.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image3','','images/m3m.jpg',3)">
<img alt="" src="images/m3.jpg" name="image3" width="73" height="95"></a></td>
<td><a href="index-3.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image4','','images/m4m.jpg',4)">
<img alt="" src="images/m4.jpg" name="image4" width="62" height="95"></a></td>
<td>
<img alt="" src="images/m5m.jpg" width="123" height="95"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<!--content-->
<tr>
<td class="w2"><table class="w1">
<tr>
<td class="w3"><table style="margin:31px 0 35px 63px;">
<tr>
<td style="height:273px;"><table style="height:100%;">
<tr>
<!--left-->
<td width="196"><table width="178">
<tr><td class="h" style="height:31px;">Our Address: </td></tr>
<tr><td>
<img alt="" src="images/5f1.jpg" style="margin-bottom:12px;" width="178" height="85"></td></tr>
<tr><td>
Conost lestecial uno dela lamoriteeselor dela siumonost de la mosesteo delrrem ipsum dolor sit amet consectetueresent vestibulum molestie lenean nonummy.
<br><br style="line-height:15px;">
9863 - 9867 Mill Road, <br>
Cambridge, MG09 99HT <br>
Tel: &nbsp; +1 989 998 92 90<br>
Fax: &nbsp;+1 989 998 92 90<br>
<br><br style="line-height:8px;">
<a href="#">Read more</a>
</td></tr>
</table></td>
<td class="b_bgr"><table style="width:2px; height:100%;">
<tr><td class="b_bgr1"></td></tr>
</table></td>
<td><img alt="" src="images/spacer.gif" width="16" height="1"></td>
<!--right-->
<td><table width="428">
<tr><td class="h">Contact Form: </td></tr>
<tr><td>Aenean nonummy hendrerit mauris. Phasellus pusce suscipit variuum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculusulla duice feugiat malesuada odio. </td></tr>
<tr>
<td class="f1"><form id="form" action="" enctype="multipart/form-data" name="form"><table style="margin:16px 0 0 0;">
<tr>
<td width="217"><table width="217">
<tr><td>Your full name:</td></tr>
<tr><td>
<input type="text" size="20"></td></tr>
<tr><td>E-mail address:</td></tr>
<tr><td>
<input type="text" size="20"></td></tr>
<tr><td>Your telephone:</td></tr>
<tr><td>
<input type="text" size="20"></td></tr>
<tr><td>Your fax:</td></tr>
<tr><td>
<input type="text" size="20"></td></tr>
</table></td>
<td><table>
<tr><td>Your message:</td></tr>
<tr><td><textarea cols="2" rows="2"></textarea></td></tr>
<tr><td style="padding:0 0 0 112px;"><a href="#" onclick="document.getElementById('form').reset()"> Reset</a><img alt="" src="images/spacer.gif" width="28" height="1"><a href="#" onclick="document.getElementById('form').submit()" >Submit</a></td></tr>
</table></td>
</tr>
</table></form></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<!--footer-->
<tr><td class="fot1">Design Bureau &copy; 2007 | <a href="index-5.html">Privacy Policy</a></td></tr>
</table></td>
<td class="rez"><table>
<tr><td class="rez4"></td></tr>
<tr><td class="rez5"></td></tr>
<tr><td class="rez6"></td></tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td class="e3"><table class="e3">
<tr>
<td class="e1"></td>
<td class="e"><table>
<tr><td></td></tr>
</table></td>
<td class="e2"></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

Thanks

thetestingsite
08-04-2007, 04:23 PM
You have one of three options:


set the action attribute in the form to mailto: youremail@domain.com
create a server side script (PHP, ASP, etc) to send to your email address
use a remotely hosted form to mail script.


Options 2 and 3 are your best bets becuase they don't require the user to send the email from their email client (and this is very unreliable). If you use the second option, look around these forums or Google for a form mail script. The last option is the same as the second; however, instead of you hosting the script on your server, it is hosted on someone else's server.

Hope this helps.

awg
08-04-2007, 04:40 PM
Hi thanks for your quick reply:) Is this file what you mean: Contact PhP file?

inside File:



<?
Error_Reporting(E_ALL & ~E_NOTICE);

while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);
$post_vars[key($_REQUEST)][0]=$pre_array[0];
$post_vars[key($_REQUEST)][1]=$pre_array[1];
}
next($_REQUEST);
}



reset($post_vars);
$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
$message='';
while ($mess = current($post_vars)) {
if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {

$message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
}
next($post_vars);
}

mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>
<script>
resizeTo(300, 300);
</script>

Can you get that working for me please?

awg
08-04-2007, 08:26 PM
Can any one help me to set it up please?

awg
08-06-2007, 08:20 AM
Hmmmmm it seems no one knows lol. On my contact page how do I activate the "submit" button? Or how can i direct the submitted information on the form to my email?

Smimmon
08-22-2007, 01:52 PM
Why not just use a ready service like http://40secscontactfrom.com
It has a spam protection function. It's very easy to install and use and there's a good description of your steps and a video tutorial.
Hope this was helpful
;)

tech_support
08-23-2007, 09:38 AM
Try this:
http://www.dynamicdrive.com/forums/showthread.php?t=23295#14

techno_race
08-27-2007, 05:47 PM
thank you!