View Single Post
  #10 (permalink)  
Old 07-28-2008, 11:09 PM
Gary White
 
Posts: n/a
Diggs:
Default Re: Form to Mail PHP

On Mon, 28 Jul 2008 17:10:37 +0000 (UTC), "Guperman"
<webforumsuser@macromedia.com> wrote:

> Array
> (
> [name] => test
> [people] => 3
> [arrival] => 5/3?08
> [time] => between 12am-1pm
> [cruiseship] => Liliship
> [check] => Yes I\'ve read the terms and conditions
> [submit] => Submit
> )


Okay. Here is your code from the form processing:

$nameField = $_POST['name'];
$peopleField = $_POST['people'];
$timeField = $_POST['time9am10am'];
$timeField2 = $_POST['time12am1pm'];
$timeField2 = $_POST['check'];


$body = <<<EOD
<br><hr><br>

Name: $name <br>
People: $people <br>
Time: $time9am10am <br>
Time2: $time12am1pm <br>
TermsConditionsChecked: $check <br>

EOD;


First, note the elements you're trying to use from the $_POST array
are:
name, people, time2am10am, time12am1pm, and check.

The actual form fields are:
name, people, time, cruiseship, and check.

Note also the variables you are assigning the form results to:

$nameField, $peopleField, $timeField, $timeField2, and (curiously)
$timeField2 again.

The variables you're putting into the message are:

$name, $people, $time8am10am, $time12am1pm and $check.

Try it this way:

$name = $_POST['name'];
$people = $_POST['people'];
$arrival = $_POST['arrival'];
$time = $_POST['time9am10am'];
$cruiseship = $_POST['cruiseship'];
$check = $_POST['check'];


$body = <<<EOD
<br><hr><br>

Name: $name <br>
People: $people <br>
Arrival: $arrival <br>
Time: $time <br>
Cruiseship: $cruiseship <br>
TermsConditionsChecked: $check <br>

EOD;

Gary
Reply With Quote