S
S
Sergey Goryachev2016-10-16 22:26:15
linux
Sergey Goryachev, 2016-10-16 22:26:15

Why is the POST request taking so long?

The usual script for sending an email.

<?php
   $back = "<p><a href=\"javascript: history.back()\">Вернуться назад</a></p>";
   if(!empty($_POST['name']) and !empty($_POST['phone'])){
      $name = trim(strip_tags($_POST['name']));
      $phone = trim(strip_tags($_POST['phone']));
      mail('[email protected]', 'Письмо с адрес_вашего_сайта',$name, $phone,"Content-type:text/html;charset=utf-8");
      echo "Ваше сообщение успешно отправлено!<br>Вы получите ответ в ближайшее время<br>$back";
      exit;
   }
   else {
      echo "Для отправки сообщения заполните все поля! $back";
      exit;
   }
?>

It takes a very long time (1 minute 16 seconds 04 milliseconds) to go to LAN.
I just can not understand what is the reason and where to dig.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sekira, 2016-10-16
@Sekira

So the mail function is running for a long time, what local server / assembly Denwer, OpenServer do you have, did you manually install Apache, PHP or what?
PS And you have Linux, but the question remains, something with DNS most likely, try to specify a normal mailbox ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question