How to run php from html in backround?

Actually the question in the title, fill out the form click send handler.php trying to open in the browser . I need handler.php did their dirty work on the server without pretending to render in the browser. How can I do that?

<?php
error_reporting(-1);
header('Content-Type: text/html; charset=utf-8');
$root=__DIR__.DIRECTORY_SEPARATOR;
require $root.'prepare.php'; #Here will be made preparatory actions, function declarations, etc.
require $root.'auth.php'; #there will be user authentication
require $root.'account_current.php'; #Here we will get information about the account
require $root.'fields_info.php'; #Get info about the fields
require $root.'contacts_list.php'; #Get information about contacts
require $root.'contact_add.php'; #Here is where we add a contact

?>
July 8th 19 at 12:11
3 answers
July 8th 19 at 12:13
If you are using php-fpm then ua2.php.net/manual/ru/function.fastcgi-finish-requ...
Otherwise fork (php.net/manual/ru/function.pcntl-fork.php https://habrahabr.ru/post/148688/), system PHP: run tasks in the background
But it's a risk, it is necessary to change the logic, perhaps to create a queue and process it one job.
July 8th 19 at 12:15
Most likely you have not installed php
Show the form code
and insert at the beginning of the file
<?php phpinfo() ?>
You should see a table in the browser with the php configuration
Installed php 7 version, show code -> - dave35 commented on July 8th 19 at 12:18
phpinfo displays the table? - brandyn.Rogahn43 commented on July 8th 19 at 12:21
: Yes , working website - dave35 commented on July 8th 19 at 12:24
Strange, but Ajax was trying to send data? - brandyn.Rogahn43 commented on July 8th 19 at 12:27
And if possible show code handler.php - brandyn.Rogahn43 commented on July 8th 19 at 12:30
: not Ajax and Jaxom, verification of clove "jazz" ( Jazz) - jerod.Herm commented on July 8th 19 at 12:33
With joy would be sent via Ajax , but I can't understand handler - dave35 commented on July 8th 19 at 12:36
header('Content-Type: text/html; charset=utf-8'); remove - brandyn.Rogahn43 commented on July 8th 19 at 12:39
good , and smarter than anything I can write with regards to this issue? - brandyn.Rogahn43 commented on July 8th 19 at 12:42
: no) - jerod.Herm commented on July 8th 19 at 12:45
Then don't stick stupid comments not relating to the question - brandyn.Rogahn43 commented on July 8th 19 at 12:48
July 8th 19 at 12:17
use Ajax or handler.php at the end of processing to give the Location header

Find more questions by tags PHPHTML