# Need little help with contact form urgent!

**URL:** <https://forum.kirupa.com/t/need-little-help-with-contact-form-urgent/270530>\
**Category:** flash\
**Created:** [September 10, 2008, 6:45pm UTC](https://forum.kirupa.com/t/need-little-help-with-contact-form-urgent/270530 "2008-09-10T18:45:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrwizard](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@mrwizard](https://forum.kirupa.com/u/mrwizard)\
**Post date:** [September 10, 2008, 6:45pm UTC](https://forum.kirupa.com/t/need-little-help-with-contact-form-urgent/270530/1 "2008-09-10T18:45:48Z")

</div>

Hi I have a contact form which works perfectly fine, i Just need to modify AS a little so it will give error alert if email or name field are blank, but I cant get it to work pls help

_ **Button code** _  
on (release) {  
for (i=1; i\<\_parent.fields\_descriptions.length; i++) {  
if (\_parent[\_parent.fields\_descriptions\*[1]]!=undefined) {  
this[\_parent.fields\_descriptions\*[1]]=\_parent[\_parent.fields\_descriptions\*[1]]+"&777&"+\_parent.fields\_descriptions\*[2];  
}

}  
this.recipient=\_parent.rec;  
//i=undefined;  
getURL(“contact.”+\_parent.serv, “\_blank”, “POST”);

}

_ **frame code** _

stop ();  
rec=“emailhere”;  
serv=“php”;  
var sunny= \_root.style

var fields\_descriptions= Array ("",  
Array(“t1”, “your\_name”, “Your Name:”),  
Array(“t2”, “your\_email”, “Your Email:”),  
Array(“t3”, “telephone”, “Telephone:”),  
Array(“t4”, “message”, “Message:”),  
Array(“t5”, “colour”, “Colour:”),  
Array(“t6”, “qty”, “Qty:”),  
Array(“t7”, “sunny”, “Style:”)  
);

for (i=1; i\<=fields\_descriptions.length; i++) {  
this[“k”+i].text=fields\_descriptions\*[2];  
}  
_ **PHP CODE** _

Quote:  
\<?  
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] .”  
";  
$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\>
