# Help With a Flash Contact Form

**URL:** <https://forum.kirupa.com/t/help-with-a-flash-contact-form/282950>\
**Category:** flash\
**Created:** [February 28, 2009, 3:31am UTC](https://forum.kirupa.com/t/help-with-a-flash-contact-form/282950 "2009-02-28T03:31:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudy\_b](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@rudy\_b](https://forum.kirupa.com/u/rudy_b)\
**Post date:** [February 28, 2009, 3:31am UTC](https://forum.kirupa.com/t/help-with-a-flash-contact-form/282950/1 "2009-02-28T03:31:31Z")

</div>

I have a form now that when submitted it uses the getURL function to post to a php page and then loads a blank confirmation page.  
But, I would like to use my existing form (that is part of the template, with a “send” button) to somehow submit the form via a php script but then load an internal flash page.

Here is the existing code:  
SEND BUTTON AS

on (release) {  
for (i=1; i\<\_parent.fields\_descriptions.length; i++) {  
if (\_parent[\_parent.fields\_descriptions\*[1]]!=\_parent.fields\_descriptions\*[2]) {  
this[\_parent.fields\_descriptions\*[1]]=\_parent[\_parent.fields\_descriptions\*[1]]+"&777&"+\_parent.fields\_descriptions\*[2];  
}  
\_parent.reset\_txt(\_parent[“t”+i], \_parent.fields\_descriptions\*[1], \_parent.fields\_descriptions\*[2]);  
}

```
this.recipient=_parent.rec;
i=undefined;
getURL("contact."+_parent.serv, "_blank", "POST");

```

}

FRAME AS

[rec="email@address.com](mailto:rec=%22email@address.com)";  
serv=“php”;

var fields\_descriptions= Array ("",  
Array(“t1”, “your\_name”, “Your Name:”),  
Array(“t2”, “your\_email”, “Your Email:”),  
Array(“t3”, “telephone”, “Your Phone:”),  
Array(“t4”, “message”, “Your Message:”),  
&nbsp;);

function reset\_txt(name,name2,value) {  
path=eval(\_target);  
path[name2]=value;

```
this[name].onSetFocus=function() {
    path=eval(_target);
    if(path[name2]==value) { path[name2]="";} 
}

this[name].onKillFocus=function() {
    path=eval(_target);
    if(path[name2]=="") { path[name2]=value;} 
}

```

}

for (i=1; i\<=fields\_descriptions.length; i++) {  
reset\_txt(“t”+i, fields\_descriptions\*[1], fields\_descriptions\*[2]);  
}

PHP CODE

[/C\<?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 ("/&lt;[^&gt;]*&gt;/", "", $pre_array[0]);
    $post_vars[key($_REQUEST)][1]=preg_replace ("/&lt;[^&gt;]*&gt;/", "", $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.="&lt;strong&gt;".$mess[1]."&lt;/strong&gt;&nbsp;&nbsp;&nbsp;".$mess[0]."&lt;br&gt;";
}
next($post_vars);

```

}

mail($\_REQUEST[‘recipient’], $subject, "  
\<html\>  
\<head\>  
\<title\>Thank You\</title\>  
\</head\>  
\<body\>  
\<br\>  
“.$message.”  
\</body\>  
\</html\>" , $headers);  
?\>  
\<html\>  
\<head\>  
\<title\>\</title\>  
\</head\>  
//HTML CODE  
\</html\>

I am not really familiar with flash, but I bought a template, and I am almost finished with the website, and I just want to be able to send and receive emails.

please help me (I am going crazy)…  
I have spent so many days and tried to find out different things, but non-worked.  
The most I ever got, was that when I am sending something, I receive a “blank” email. so there is some communication going on, but no messages or nothing is sent.  
I can see that in the template, there are actually places that I can enter text and they are named correspondingly (e.g. I can see a Var: your\_name, and another Var: your\_email, and Var: message). So, I think the naming convention is being used correctly inside php. But for some reason, I can only receive blank emails with No message, No subject.  
please help…
