On the pages of the site there is a link "Order", which leads to the form page form.php, loaded in a modal window through Fancybox.
The script itself looks like this:
<?php header("Content-Type: text/html; charset=utf-8"); if (isset($_POST['order'])) { $to = 'name@mail.ru'; $subject = 'Заявка'; $message = "Имя: ".$name = $_POST['name']."\r\n"; $message .= "Номер телефона: ".$phone = $_POST['phone']."\r\n"; $message .= 'Страница: ' . $_SERVER["HTTP_REFERER"]."\r\n"; $headers = 'From: info@site.ru' . "\r\n" . 'Reply-To: info@site.ru' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); header('Location: /success.html'); } ?> The problem is that the letter in the "Page" field indicates a link to the form itself.
How to make, so that the previous (main) page is displayed? That is, the one with the bark form was loaded.
$_POST, and the script just accept and give it. - Let's say Pie