There is a send.php page on it accepting an array of a post, and sending a letter to an email, and immediately redirects to the header ("location: here is the main page"); and everything seems to be good! But before going to the main page, for some reason it shows the contents of the sent letter on the send.php page. and there are no conclusions on it. What is the problem tell me?
Here is the code:
header ('Content-type: text/html; charset=windows-1251'); $email_to = '4up@mail.ru'; $name = $_POST['fio']; $email = $_POST['email']; $phone = $_POST['phone']; if($_POST['count']){ $count = $_POST['count']; } else{ $count = 'не заполнено'; } if($_POST['rayon']){ $rayon = $_POST['rayon']; } else{ $rayon = 'не заполнено'; } if($_POST['date']){ $date = $_POST['date']; } else{ $date = 'не заполнено'; } if($_POST['price']){ $price = $_POST['price']; } else{ $price = 'не заполнено'; } $type_deal = $_POST['type_check']; $type_real_estate = $_POST['type_check2']; $message = $_POST['comm']; $message = "Имя : " . $name . "\r\n email : " . $email . "\r\n Телефон : " . $phone . "\r\n тип сделки : " . $type_deal . "\r\n Тип недвижимости : " . $type_real_estate ."\r\n количество комнат : ".$count."\r\n В районе : ".$rayon."\r\n Сроки сдачи : ".$date."\r\n Ориентировачная стоимость : ".$price."\r\n текст сообщения : " . $message; $headers = "From: $email\r\n"; $headers .= "Reply-To: $email\r\n"; mail('4up@mail.ru',$headers,$message); header("Главная страница");