giris.php
if ($say==1) {
$_SESSION['kullanici_mail']=$kullanici_mail;
$_SESSION['alert'] = array("type" => "success", "title" => "Tebrikler", "text" => "Giriş Başarılı");
header("refresh:2,index.php");
} else {
$_SESSION['alert'] = array("type" => "error", "title" => "Hata", "text" => "Giriş Olmadı");
}index.php veya başka sayfalar
// Bu kodu index.php veya hangi sayfaya istiyorsan o sayfanın en altına ekle.
// Bu kodu index.php veya hangi sayfaya istiyorsan o sayfanın en altına ekle.
if(isset($_SESSION['alert'])) {
echo '<script>swal({
title: "'.(($_SESSION["alert"]["title"]) ? $_SESSION["alert"]["title"] : null).'",
text: "'.(($_SESSION["alert"]["text"]) ? $_SESSION["alert"]["text"] : null).'",
type: "'.(($_SESSION["alert"]["type"]) ? $_SESSION["alert"]["type"] : null).'",
timer: 2000,
showConfirmButton: false
});</script>';
}