javascript alert not working if i use php redirect?
<p>i have code written something like this.</p>

<pre><code>    if(!isset($cid))
    {
        echo "&lt;script type=\"text/javascript\"&gt;alert('OOps, Something went wrong, please make sure you select country from the list')&lt;/script&gt;";
        header('Location:location-manager.php?view=countries');
        exit;
    }
</code></pre>

<p>the above code will only redirect the page and ignores the JS alert. if i remove header() then it alerts with  JS alert box. what is wrong with my code? isn't it possible for me to alert the user with the error from JS alert and then redirect it to desired page?</p>
