I have one issue while trying to display alert message using PHP.I am explaining my code below.
<?php
if($id){
$message = "Added successfully.";
echo "<script type='text/javascript'>alert('$message');</script>";
header("location:http://localhost/crm_complain/index.php");
}else{
$message = "Unable to add.\\nTry again.";
echo "<script type='text/javascript'>alert('$message');</script>";
header("location:http://localhost/crm_complain/index.php");
}
?>
Here my problem is the alert message box is not working at all.I need inside the if/else condition the alert message should work.Please help me.