This is an interesting one...
I am trying to test for something, then show an alert then once the OK is clicked relocate the page to somewhere else, using header 
However if I have the code below it just goes straight to the URL.
If I comment out the header then the alert works....
elseif ($user['archived']=="1"){
    echo "<script type='text/javascript'>alert('Sorry you are no longer an owner');</script>";
    sleep(10);
    header('location: https://some URL'); 
}
 
     
    