# Email form

**URL:** <https://forum.kirupa.com/t/email-form/280199>\
**Category:** Uncategorized\
**Created:** [January 24, 2009, 12:11am UTC](https://forum.kirupa.com/t/email-form/280199 "2009-01-24T00:11:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fivepoints](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fivepoints](https://forum.kirupa.com/u/fivepoints)\
**Post date:** [January 24, 2009, 12:11am UTC](https://forum.kirupa.com/t/email-form/280199/1 "2009-01-24T00:11:06Z")

</div>

Can somebody help me. I am trying to set up a simple email form in my flash site. The web host is GODaddy. The script below is what they gave me to use. Everything works fine except when I get the email results, the variables I defined in my flash form comes back as undefined. How do I define three variables in this script below. The variables are “name”,“email”, “comments” I’m still struggling with flash. PHP is a whole new mountain for me. Help!!!

\<?php  
$request\_method = $\_SERVER[“REQUEST\_METHOD”];  
if($request\_method == “GET”)  
{  
$query\_vars = $\_GET;  
}  
elseif ($request\_method == “POST”)  
{  
$query\_vars = $\_POST;  
}  
reset($query\_vars);  
$t = date(“U”);  
$file = $_SERVER[‘DOCUMENT\_ROOT’] . "\ssfm\gdform_" . $t;  
$fp = fopen($file,“w”);  
while (list ($key, $val) = each ($query\_vars))  
{  
fputs($fp,"\<GDFORM\_VARIABLE NAME=$key START\>  
“);  
fputs($fp,”$val  
“);  
fputs($fp,”\<GDFORM\_VARIABLE NAME=$key END\>  
");  
if ($key == “redirect”)  
{  
$landing\_page = $val;  
}  
}  
fclose($fp);

if ($landing\_page != “”)  
{  
header(“Location: http://”.$\_SERVER[“HTTP\_HOST”]."/$landing\_page");  
}  
else  
{  
header(“Location: http://”.$\_SERVER[“HTTP\_HOST”]."/");  
}  
?\>
