[FONT=verdana]Good morning everyone -
I have created the form and it passes the variables to a PHP file using ActionScript 2. It works perfectly when I just open it in Flash player or Firefox locally on my computer - the email goes out, all the variables are passed. However, it doesn’t work when I put all of the files online.
Does anyone have any guesses? I’m copying the code below in case you need to see it. You can also check out the form at http://www.zilyen.com/staging/form. Thanks in advance for your help!
ActionScript 2 Code
var senderLoad:LoadVars = new LoadVars();
sender.onRelease = function() { //sender is the instance name of the submit button
senderLoad.firstName = form.firstName.text; //these names correspond to each of the text fields in the movie clip named “form”
senderLoad.lastName = form.lastName.text;
senderLoad.email = form.email.text;
senderLoad.company = form.company.text;
senderLoad.title = form.title.text;
senderLoad.phone = form.phone.text;
senderLoad.address = form.address.text;
senderLoad.sendAndLoad(“http://www.zilyen.com/staging/form/form.php”, “POST”);
};
PHP Code
<?php
$sendTo = "gigi@zilyen.com";
$subject = “New ZilYen Contact!”;
// Populate PHP variables from Flash variables
$name = $_POST[‘firstName’] ." ". $_POST[‘lastName’];
$email = $_POST[‘email’];
$company = $_POST[‘company’];
$title = $_POST[‘title’];
$phone = $_POST[‘phone’];
$address = $_POST[‘address’];
$source = $_POST[‘how’];
// Trim the variables
$name = trim($name);
$email = trim($email);
$company = StripSlashes($company);
$title = StripSlashes($title);
$phone = trim($phone);
$address = StripSlashes($address);
$source = StripSlashes($source);
// header information not including sendTo and Subject
$headers = “From: " . $name . " <” . $email . ">
" . "Reply-To: " . $email . "
" . "Return-path: " . $email;
// add message content with variables
$message = "Full Name: " . $name . "
";
$message .= "E-mail: " . $email . "
";
$message .= "Company: " . $company . "
";
$message .= "Job Title: " . $title . "
";
$message .= "Phone Number: " . $phone . "
";
$message .= "Address: " . $address . "
";
$message .= "Source: " . $source . "
";
// mail function
mail($sendTo, $subject, $headers, $message);
?>[/FONT]