Hii
I created a flash contact form using a tutorial and I can't get it to work with the gdform.php file of the godaddy.com server that is hosting my site.
I'm not familiar with this because I have never done it before, so far what I have done is to ad the name of the file in the godaddy sever "/gdform.php" to the flash form but it doesn't work.
This is the part of the flash form that should be dealing with sending the variables to the php file.
Code:
// ---------<Sent Form>------------ \\
var feedbackForm:LoadVars = new LoadVars();
function sendForm () {
feedbackForm.email_to = "[email protected]";
feedbackForm.visitor_name = _parent.contactForm.userName.text;
feedbackForm.visitor_email = _parent.contactForm.userEmail.text;
feedbackForm.visitor_comments = _parent.contactForm.userComments.text;
feedbackForm.send("/gdform.php", "POST");
}
// ---------</Sent Form >------------ \\
this.contactForm.userName.tabIndex = 1;
this.contactForm.userEmail.tabIndex = 2;
this.contactForm.userComments.tabIndex = 3;
This is the information inside the gdform.php file
Code:
<?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'] . "/../data/gdform_" . $t;
$fp = fopen($file,"w");
while (list ($key, $val) = each ($query_vars)) {
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
fputs($fp,"$val\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
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"]."/");
}
?>
Any ideas what should I do to get this flash form to work?
Thanks
Alex