I am trying to display an alert message after the record is inserted in the datbase and normal js alert is working fine and displaying the message.
echo '<script>';
echo 'alert(" Your request has been successfully filled and your Letter No is\n'.$Dep.'/'.$fy.'/ "+"'.$id.'.\nKindly submit the original copy of this letter to CRDS.")';
echo '</script>';
echo "<script>window.location.href='dashboard.php'</script>";
exit;
But when I am using sweet alert function instead of normal js function it does not display any message.it is directly taking me to header.I tried it with sweet alert2 but no joy. Though data is inserted but message not displayed What is wrong in my code I have included sweet alert library in my code.My code is
echo '<script>';
echo 'swal(" Your request has been successfully filled and your Letter No is\n'.$Dep.'/'.$fy.'/ "+"'.$id.'.\nKindly submit the original copy of this letter to CRDS.")';
echo '</script>';
echo "<script>window.location.href='dashboard.php'</script>";
exit;