I need to run an index.php script that calls an external script which takes a few seconds to run, before redirecting to index.html. Is it possible for the php script to load the same index.html into the browser in the meantime so the screen isn't blank? If not what would be the way to handle this? My best effort is:
<?php
$doc = new DOMDocument();
$doc->loadHTMLFile("index.html");
echo $doc->saveHTML();
shell_exec('./shellscript.sh');
header('Location: index.html');
exit;
?>
which fails to load with:
Warning: DOMDocument::loadHTMLFile(): Tag nav invalid in index.html, line: 33 in {pathto}/index.php on line 3
That line of index.html is - <nav class="navbar navbar-inverse navbar-fixed-top">
Grateful for assistance.
shell_exec('foo &'), but then you couldn't wait for the results.