I am trying to display an alert message after the record is inserted in the datbase and normal js alert is working fine the code for this is
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.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;