Hi People
I am trying to write some code that displays a small message to an e-mail recipient informing them to add a persons record to a database only if they enable a radio button on the html form ('mail_yes_no').
It is a simple if statement but I am unsure of how to define the variable. Can you please help here is the code.
$to = "user@website.com";
$subject = "Web Site Feedback";
$from = "From: {$_POST['user_e_mail']}";
$body =
"Name: {$_POST['username']}\n".
"E-mail:{$_POST['user_e_mail']}\n".
"Subject: {$_POST['subject']}\n\n".
"Comments: {$_POST['user_comments']}\n".
"Add to mail database: {$_POST['mail_yes_no']}\n";
&dbase = '$_POST['mail_yes_no']';
if ( &dbase == yes)
echo 'Add this person to database';
mail( $to, $subject, $body, $from,);
Thanks in advance.
🙂