Witam,
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?
<form action="form.php" method="post" name="form" id="form" onsubmit="usun_pl(this)" accept-charset="utf-8"> <select name="dzial" class="input_kontakt" />
początek form.php
if (count($_POST['dzial'] == 'dzial1'))
{
////////// 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)
{
{
for ($i = 0; $i < count($value); $i++) {
}
}
}
}
else if(count($_POST['dzial'] == 'dzial2'))
{
////////// 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)
{
{
for ($i = 0; $i < count($value); $i++) {
}
}
}
}