Alert box is not working at the time of submitting the form. Nevertheless, I get 'Customer Added Successfully' message in php. But I don't get an alert box. My code is given below:
if($_POST['submit'])
{
$name=$_POST['name'];
$phone_number=$_POST['phone_number'];
$email=$_POST['email'];
$sql="insert into
customer set name='$name',phone_number='$phone_number',email='$email'";
$in executeUpdate($sql);
if($in)
{
echo "<script type=\"text/javascript\">".
"alert('success');".
"</script>";
$sess_msg="Customer Added Successfully.";
$_SESSION['sess_msg']=$sess_msg;
}
header("Location: addCustomer.php");
}