PDA

View Full Version : Help Me Before I Hang Myself



rcaira
July 25th, 2007, 10:09 AM
:hitman: Hi All :hitman:

I am in a pickle. I need to build a flash form that will send back the variable data entered by the customer. I used the Script below and it sends back the From:, To:, Subject just fine, but I only get the ""message"" data back from the form. What I need to do is add about 20 more fields, see the remarks in the PHP script below. Any help would be greatly appreciated.

PHP Script: :sen:

<?php
$sendTo = "MyEmail@MyEmail.com";
$subject = "Online Booking Request";
$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["email"];
$message = $_POST["message"];
$Address = $_POST["address"]; //<< Need to add more fields like this, city, state etc... and have the values returned in the email>>//
mail($sendTo, $subject, $message, $headers);
?>

Flash Button Code::sen:

on (release) {
// send variables in form movieclip (the textfields)
// to email PHP page which will send the mail
form.loadVariables("http://www.MyWesiteAddess.com/email.php", "POST");
}

Charleh
July 25th, 2007, 12:22 PM
:hitman: Hi All :hitman:

I am in a pickle. I need to build a flash form that will send back the variable data entered by the customer. I used the Script below and it sends back the From:, To:, Subject just fine, but I only get the ""message"" data back from the form. What I need to do is add about 20 more fields, see the remarks in the PHP script below. Any help would be greatly appreciated.

PHP Script: :sen:

<?php
$sendTo = "MyEmail@MyEmail.com";
$subject = "Online Booking Request";
$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["email"];
$message = $_POST["message"];
$Address = $_POST["address"]; //<< Need to add more fields like this, city, state etc... and have the values returned in the email>>//
mail($sendTo, $subject, $message, $headers);
?>

Flash Button Code::sen:

on (release) {
// send variables in form movieclip (the textfields)
// to email PHP page which will send the mail
form.loadVariables("http://www.MyWesiteAddess.com/email.php", "POST");
}

$message is the name of a variable which contains the message that gets passed to the mail() function. All you need to do is add your values on the end using the '.' concatenation operator - such as

$message = $_POST["message"];
$message .= " " . $_POST["address"];
$message .= " " . $_POST["address2"];
$message .= " " . $_POST["address3"];

And so on.

I've added a space " " between each variable ... you may want to break the lines up using CRLFs, look up the chr() or char() function (I think there's one in PHP).

You should be able to go

$message .= chr(13) . $_POST["address"];

I think...