I am sending the same emails to a number of members. As there are quite a lot of them the process takes a while and I want to show some sort of progress indicator on the screen while it is going on.
I have devised a very simple indicator in which another dot is added to the text every time an email is sent. I thought this would work OK but there is a problem in that it seems the screen does not refresh until all the emails are sent, so all that happens is that the screen hangs until the process is completed and then the indicator appears with all its dots in place.
Any ideas why this is happening?
I have devised a very simple indicator in which another dot is added to the text every time an email is sent. I thought this would work OK but there is a problem in that it seems the screen does not refresh until all the emails are sent, so all that happens is that the screen hangs until the process is completed and then the indicator appears with all its dots in place.
Any ideas why this is happening?
PHP:
while ($row = mysqli_fetch_array($result)) { //start of 'while' loop
If ($row['SENDEMAIL'] == "Y") { //only send to regular members
$dot = $dot . " . "; //dot for progress indicator
echo "<div class='thankyou' id='progress'>";
echo "<h style='font-size:125%; font-weight:bold;'>Emailing " . $dot;
echo "</div>";
//die;
$MSGBODY = "<font face='verdana' size='2'>Hi " . $row['NAME'] . "<br><br>" . $BODY;
//$toaddress = $row['E_MAILADDRESS'];
$toaddress = "[email protected]"; //for testing
mail($toaddress, $subject, $MSGBODY, $headers);
//die;
} //If ($row['SendEmail'] == "Y")
} //while ($row = mysqli_fetch_array($result))