PDA

View Full Version : Help with E-Mail Web Form



meshaq2000
08-30-2012, 07:03 AM
I've been searching all over to try to resolve my problem with this web form and I'm having no luck. I purchased a template on templatemonster.com and I can't get the web form to send an e-mail through the website.

I've seen several similar threads, but because I'm completely ignorant on this subject I can't make their solutions work.

First - here's the action script in swish (I got a swish template):

onSelfEvent (load){
recipient=_root.recipient;

_root.serv=_root.server_option;
_parent.fields_descriptions= Array ("",
Array("t1", _root.contact_1, "your_name"),
Array("t2", _root.contact_2, "your_email"),
Array("t3", _root.contact_3, "your_message")
);
for (i=1; i<=_parent.fields_descriptions.length; i++) {
this['t'+i].text=_parent.fields_descriptions[i][2];
}
}

Next - here's the contact.php:
<?php
Error_Reporting(E_ALL & ~E_NOTICE);

while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);

$post_vars[key($_REQUEST)][0]=preg_replace ("/<[^>]*>/", "", $pre_array[0]);
$post_vars[key($_REQUEST)][1]=preg_replace ("/<[^>]*>/", "", $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('isaac@happy-pantry.com', $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Huzzah! Your message was so good we didn't just want to send it, we NEEDED to send it!");

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

Is this all correct and there's a problem somewhere else? Is there something I'm missing?

Thanks for the help - and sorry for the long mesage! Let me know if there's any information I forgot to include!