very new to php and trying to get a grip on its power.
i have a successful registration form on my html page, which on submit triggers the php file.
the file generates 2 emails - the first one to the office ( giving all the registration information) and the second
to the person who registered/submitted the form.
i don't want the person who registered to recieve ALL the info filled in. i want to omit specific fields.
i know my php code checks for all filled in ( not empty ) fields, and returns them. so how do i get this code to NOT return certain
fields? ( for example, to not return a field with name='ccinfo' and id='ccinfo' )
this is the chunk of code so far:
Code: Select all
function build_message2($request_input){if(!isset($message_output)){$message_output ="";}if(!is_array($request_input)){$message_output = $request_input;}else{foreach($request_input as $key => $value){if(!empty($value)){if(!is_numeric($key)){$message_output .= str_replace("_"," ",ucfirst($key)).": ".build_message($value).PHP_EOL.PHP_EOL;}else{$message_output .= build_message($value).", ";}}}}return rtrim($message_output,", ");}
$message2 = build_message2($_REQUEST);
$message2 = $message2 . PHP_EOL.PHP_EOL."-- ".PHP_EOL."";
$message2 = "Thank you for registering. Below is the information you provided. \n If there are any errors, please let us know.\n\n\n NAME: ".stripslashes($message2);
$subject2 = "Your Registration Confirmation 2";
$headers2 = "From: office@myOrg.org" ;
mail($_REQUEST['email'],$subject2,$message2,$headers2);