There are 3 forms on the page. The values of the fields, depending on the submitted form, fall into an array ( $form _data ).
if (isset($_POST['login_button'])){ $subject = " registration "; $form_data = array("name" => "{$_POST['name_call_me']}", "question" => "{$_POST['question']}", "phone" => "{$_POST['phone_call_me']}" ); } elseif (isset($_POST['send_btn_call_me'])){ $subject = " did't find a product you need "; $form_data = array("login" => "{$_POST['login']}", "password" => "{$_POST['password']}" ); } elseif (isset($_POST['contact_sent'])){ $subject = " contact "; $form_data = array("name" =>"{$_POST['contact_name']}", "email" => "{$_POST['contact_email']}", "phone" => "{$_POST['contact_phone']}", "subject" => "{$_POST['contact_subject']}", "massage" => "{$_POST['contact_massage']}" ); }; The question is how to implement the feedback function, depending on the form submitted. Like that :
function sent(принимаемый массив $form_data){ в зависимости от выбора формы отправка письма на почту, используя значения из принятого массива}
function sent($_POST), and then parse $ _POST and generate the send. for a more detailed answer write the code of your sending letter in the question. - Alex