Most likely, the script is timing out for some users because they have a slower connection. there are 2 PHP settings that can be changed to account for this:
1) max_execution_time:
It specifies the maximum amount of time (in seconds) that is allowed for each PHP script to execute.
The default value is 30.
2) max_input_time:
It specifies the maximum amount of time (in seconds) that is allowed for each PHP script to receive the client's HTTP request.
The default value is 60.
To find out what those those to are set to, you can add the following in the body of your page:
max_execution_time: <?php echo(ini_get('max_execution_time')); ?><br />
max_input_time: <?php echo(ini_get('max_input_time')); ?><br />
to change the values, add the following at line 1 of your page:
<?php
ini_set("max_execution_time", 120);
ini_set("max_input_time", 120);
?>
you may need to increase the number of seconds to account for slower connections.