mam problem z formularzem, w ktorego wrzuciłem opcję wyboru do jakiego działu ma iść email, problem w tym że obojętnie co zaznaczę idzie mi na email1, jak zaznacze dział 2 to powinno pojść na email2 a idzie na email1, widzicie może jakieś błędy w tym kodzie?
początek form.php
{ ////////// USTAWIENIA ////////// $email = 'email1@wp.pl'; // Adres e-mail adresata $subject = 'formularz ze strony'; // Temat listu $message = ''; // Komunikat $error = ''; // Komunikat błędu $charset = 'utf-8'; // Strona kodowa ////////////////////////////// $head = "MIME-Version: 1.0\r\n" . "Content-Type: text/plain; charset='utf-8'\r\n" . "Content-Transfer-Encoding: 8bit"; $body = ''; foreach ($_POST as $name => $value) { { { } } } echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ? $message : $error; } { ////////// USTAWIENIA ////////// $email = 'email2@wp.pl'; // Adres e-mail adresata $subject = 'formularz ze strony'; // Temat listu $message = ''; // Komunikat $error = ''; // Komunikat błędu $charset = 'utf-8'; // Strona kodowa ////////////////////////////// $head = "MIME-Version: 1.0\r\n" . "Content-Type: text/plain; charset='utf-8'\r\n" . "Content-Transfer-Encoding: 8bit"; $body = ''; foreach ($_POST as $name => $value) { { { } } } echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ? $message : $error; }