no es necesario agregar el punto solo debes colocar tu codigo de esta manera echo '<script> Swal.fire({ icon: "success", title: "Your work has been saved", showConfirmButton: false, timer: 2500 }); window.location = "../admin/admin-culture.php"; </script>';