I try to run the following tasks
<?php
echo "<script>alert('yes');</script>";
flush();
header('Location: ' . 'index.php');
exit;
?>
but just one task could work. if I remove flush(), I will not see the alert box. If I use flush() the header can not redirect.
any suggestions or solutions