(PHP)how to hold javascript alertbox on screen
- by Piyush
when user changes password I want to show message "Successfully changed!" and when user clicks on OK button of alert box I call logout.php and force user to login with new password.But the problem is PHP header() is not waiting for alertbox and directly goes to logout.php.
my code-
if($count==1)
{
$sqlchange="UPDATE $tbl_name SET password='$newpassword' WHERE userId='$myusername'";
unset($result);
$result=mysql_query($sqlchange,$link);
if($result>0)
{ ?>
<script type="text/javascript">
alert("Your Password has been changed successfully.Please login again.");
</script>
<?php
header("location:logout.php");
exit;
}
else
{....