(PHP)how to hold javascript alertbox on screen
<p>when user changes password I want to show message "Successfully changed!" and when user clicks on <strong>OK</strong> button of <strong>alert box</strong> I call <strong>logout.php</strong> and force user to login with new password.But the problem is PHP <strong>header()</strong> is not waiting for alertbox and directly goes to logout.php.
my code-</p>

<pre><code>if($count==1)
{
    $sqlchange="UPDATE $tbl_name SET password='$newpassword' WHERE userId='$myusername'";
    unset($result);
    $result=mysql_query($sqlchange,$link);
    if($result&gt;0)
        { ?&gt;
        &lt;script type="text/javascript"&gt;
        alert("Your Password has been changed successfully.Please login again.");
        &lt;/script&gt;
        &lt;?php
        header("location:logout.php");
        exit;
        }
    else 
        {....
</code></pre>
