I'm building a homepage where after the user have filled a form I need to run a rather long PHP script (populating my database). Therefor I'm trying to make a loading page to be displayed while the script is running and once it's done redirect to some other page.
I'm currently doing:
In form.php
<form method="post" action="load.php">
....
</form>
load.php have the loading page:
<?php
ob_start();
?>
<!DOCTYPE HTML>
<html>
...loading page here...
</html>
<?
ob_end_flush();
include 'add.php';
?>
Here i hope to show the page with ob_start and ob_end_flush, and the begin the script.
at the end of add.php I do
header('Location: redirect_to_here.php');