I have the following which I'm testing, after you login you will be presented with a "your login is being processed" + a animated image.
I would prefer not to use Javascript to redirect the user, is it possible to use header ('Location: '); because when i replace the javascript with it I get;
Warning: Cannot modify header information - headers already sent by
$file = fopen ('../sources/process_login.php', 'r');
$read_file = fread ( $file, filesize ('../sources/process_login.php') );
fclose ($file);
echo $read_file;
flush();
sleep (3);
echo '<script>window.location.href="../index.php"</script>';
exit;