# Contact From not working anymore? Help!

**URL:** https://forum.kirupa.com/t/contact-from-not-working-anymore-help/188808
**Category:** Uncategorized
**Created:** [May 10, 2006, 11:33pm UTC](https://forum.kirupa.com/t/contact-from-not-working-anymore-help/188808 "2006-05-10T23:33:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bash](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@bash](https://forum.kirupa.com/u/bash)
#### Post date: [May 10, 2006, 11:33pm UTC](https://forum.kirupa.com/t/contact-from-not-working-anymore-help/188808/1 "2006-05-10T23:33:32Z")

</div>

I recently downloaded a flash template.

Everything works fine but the contact form under the contact menu does not work! It returns “connection error”.

It was working before but i somehow meddled with the actionscript and cannot fix it!!!

I have included the actionscript code for the contact form. clear/send buttons.

I am really stuck on this one and hope someone can help me please??

Thanks in advance.

Here is the website link  
[www.sendhere.pwp.blueyonder.co.uk/unique/index.html](http://www.sendhere.pwp.blueyonder.co.uk/unique/index.html)

Contact form code  
\<?phpr  
$error = false;  
$to = ‘mobashirsheikh@hotmail.com’;  
if (!isset($\_POST[‘fname’]) || trim($\_POST[‘fname’]) == ‘’) {  
$err\_message = “First name field is empty.”;  
$error = true;  
}  
if (!isset($\_POST[‘lname’]) || trim($\_POST[‘lname’]) == ‘’) {  
$err\_message = “Last name field is empty.”;  
$error = true;  
}  
if (!isset($\_POST[‘email’]) || trim($\_POST[‘email’]) == ‘’) {  
$err\_message = “Email field is empty.”;  
$error = true;  
}  
if(!isset($\_POST[‘message’]) || trim($\_POST[‘message’]) == ‘’) {  
$err\_message = “Message field is empty.”;  
$error = true;  
}

if (!$error) {  
$fname = htmlspecialchars(trim($\_POST[‘fname’]));  
$lname = htmlspecialchars(trim($\_POST[‘lname’]));  
$email = htmlspecialchars(trim($\_POST[‘email’]));  
$phone = isset($\_POST[‘phone’]) ? htmlspecialchars(trim($\_POST[‘phone’])) : ‘’;  
$message = htmlspecialchars(trim($\_POST[‘message’]));  
if (!ereg("^\_a-zA-Z0-9-\*@([a-zA-Z0-9-]{2,}.){0,}[a-zA-Z0-9-]{3,}(.[a-zA-Z]{2,4}){1,2}$", $email)) {  
$error = true;  
$err\_message = ‘Email address is incorrect.’;  
}  
if($phone != ‘’) {  
if (ereg("[^0-9 ()-]+", $phone)) {  
$error = true;  
$err\_message = ‘Phone number is incorrect.’;  
}  
}  
if (!$error) {  
$email\_body = ‘\<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”\>  
\<html\>\<head\>  
\<meta http-equiv=Content-Type content=“text/html; charset=cp1252”\>  
\<style type=“text/css”\>  
body, td {  
font-family:Tahoma;  
font-size:12px;  
color:#000000;  
}  
.frame\_table {  
background-color:#cccccc;  
border-width:1px;  
border-style:solid;  
border-color:#663333;  
}  
.frame\_table td{  
background-color:#ffffff;  
color:#666666;  
}  
.frame\_table td.title{  
background-color:#666666;  
color:#ffffff;  
font-weight:bold;  
}  
\</style\>  
\</head\>  
\<body bgcolor=#ffffff\>  
\<center\>  
\<span style=“font-size:20px; font-weight:bold; color:#666666;”\>Contacts\</span\>  
\<br\>\<br\>  
\<table border=“0” cellspacing=“1” cellpadding=“1” width=“95%” align=“center” class=“frame\_table”\>  
\<tr\>\<td class=“title”\>First name\</td\>\<td\>’.$fname.’\</td\>\</tr\>  
\<tr\>\<td class=“title”\>Last name\</td\>\<td\>’.$lname.’\</td\>\</tr\>  
\<tr\>\<td class=“title”\>E-Mail\</td\>\<td\>’.$email.’\</td\>\</tr\>  
\<tr\>\<td class=“title”\>Phone\</td\>\<td\>’.$phone.’\</td\>\</tr\>  
\</table\>  
\<br\>  
\<div style=“width:95%; border-width:1px; border-style:solid; border-color:#cccccc; padding:5px; text-align:left;”\>’.$message.’\</div\>  
\</center\>  
\</body\>\</html\>’;

```
    $headers = 'MIME-Version: 1.0'."

```

“;  
$headers = ‘From:’.$email.”  
“;  
$headers .= ‘Content-Type: text/html;’.”  
";  
if(!mail($to, “Feedback from your site”, $email\_body, $headers)) {  
$err\_message = “Couldn’t sent message.”;  
$error = true;  
} else {  
$err\_message = “Thank you for your message!”;  
}  
}  
}  
if ($error) {  
echo “&check=0&answerword=”.$err\_message;  
} else {  
echo “&check=1&answerword=”.$err\_message;  
}  
?\>

* * *

Send button code  
on (rollOver) {  
gotoAndPlay(“s1”);  
}  
on (releaseOutside, rollOut) {  
gotoAndPlay(“s2”);  
}  
on (release) {  
contactForm.requestVars = new LoadVars();

contactForm.requestVars.onLoad = function(success)  
{  
trace(“onLoad:”+success);  
if(success) {  
if(this.check == 1) {  
contactForm.fname\_str = “”;  
contactForm.lname\_str = “”;  
contactForm.email\_str = “”;  
contactForm.phone\_str = “”;  
contactForm.message\_str = “”;  
}  
contactForm.answerword = this.answerword;  
contactForm.gotoAndStop(“end”);  
trace(“answerword:”+this.answerword);  
} else {  
contactForm.answerword = “Connection error”;  
contactForm.gotoAndStop(“end”);  
}  
}

contactForm.requestVars.fname = contactForm.fname\_str;  
contactForm.requestVars.lname = contactForm.lname\_str;  
contactForm.requestVars.email = contactForm.email\_str;  
contactForm.requestVars.phone = contactForm.phone\_str;  
contactForm.requestVars.message = contactForm.message\_str;  
contactForm.requestVars.sendAndLoad(“contact.php”, contactForm.requestVars, “post”);  
contactForm.gotoAndStop(“loading”);  
}

* * *

Clear Button code  
on (rollOver) {  
gotoAndPlay(“s1”);  
}  
on (releaseOutside, rollOut) {  
gotoAndPlay(“s2”);  
}  
on (release) {  
contactForm.fname\_str = “”;  
contactForm.lname\_str = “”;  
contactForm.email\_str = “”;  
contactForm.phone\_str = “”;  
contactForm.message\_str = “”;  
}
