data['port'] = "Louisville")echo 'Thanks, Louisville';elseecho 'Thanks, Jeffersonville';?>"> Form data in email - Forums

Forums

Form data in email

rstevens 29 Jul, 2011
I want to send a simple email message confirmation to people who fill out a form about ports. However, I am unable to figure how to make it work properly. If someone selects a radio button for Louisville, then they should get a message that says "Thanks, Louisville." If they select Jeffersonville, the message should reflect that.

However, I get only a message that says "Thanks, Louisville" regardless of which radio button I select. Any suggestions? Thanks.

<?php
if ($form->data['port'] = "Louisville")
echo 'Thanks, Louisville';
else
echo 'Thanks, Jeffersonville';
?>
GreyHead 31 Jul, 2011
Hi rstevens,

The if statement needs '==' instead of just '='
<?php
if ( $form->data['port'] == "Louisville" ) {
  echo 'Thanks, Louisville';
} else {
  echo 'Thanks, Jeffersonville';
}
?>

Bob
This topic is locked and no more replies can be posted.