I've been a CF Dev for 12 years and have decided to take on PHP, so may I just say up front, nice to meet all of you!
I'm attempting to configure a simple mail script a client downloaded somewhere and where it's getting me is when it has more than two fields. Either no email or email with blank body.
The original script is:
<?php
if ( isset ( $_POST [ 'buttonPressed' ])){
$to = 'wherever' ;
$subject = 'From PHP contact page' ;
$message = $_POST [ "message" ];
$headers = 'From: ' . $_POST [ "from" ] . PHP_EOL ;
mail ( $to , $subject , $message , $headers );
header("Location: wherever");}
else {
?>
My modified version has another form field so I have named them message1 and message2:
<?php
if ( isset ( $_POST [ 'buttonPressed' ])){
$to = 'wherever' ;
$subject = 'From PHP contact page' ;
$message1 = $_POST [ "message1" ];
$message2 = $_POST [ "message2" ];
$headers = 'From: ' . $_POST [ "from" ] . PHP_EOL ;
mail ( $to , $subject , $message1 , $message2 , $headers );
header("Location: wherever");}
else {
?>
I've been looking at PHP code sites all afternoon and it seems there are a number of ways of doing this but I haven't been able to get any to work. I bought a book on Amazon for PHP5 (my version is 5.3.8 I believe) and I'm waiting for it to arrive.
Thanks!
David

