I have created a script which adds "y" or "n" to a database for over 50 fields, then emails the results to a specified email address.
I was wondering how I could just email the results that have "y" in them, such as:
if $field = y add to email message with description in front then . chr(13) . chr(10) .
else
skip to next field
repeat
Code:
$to = 'user@domain.com';
$subject = $required_field . " - " . "Description: $required_field2";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/plain; charset=iso-8859-1' . "\r\n";
$message (4 required fields then the added fields that have y separated by . chr(13) . chr(10) . );
$mail_sent = @mail( $to, $subject, $headers, $message,'-fuser@domain.com');
Can anyone suggest a solution?😕