In order to get a better idea of how to implement these types of solutions, we will create an animated transition that will wrap itself around a very slow PHP script. Thus, we will try to influence the perceived speed of the original script.
Our original PHP script will simulate slow execution by running a sleep command. Here is the content of the original script:
<?php// chap10_slow_before.phpsleep(5);echo 'The original page loads very slowly...';
If we run this script immediately, we definitely perceive that the script is slow and that the elapsed time could make us believe that something is going wrong: