$sor = $db->prepare("SELECT * FROM user where user_eposta=? and user_sifre=?");
	$sor->execute(array($ad, $sifre));
	$uyeise = $sor->fetch(PDO::FETCH_ASSOC);
	if ($uyeise) {
		header('location:../anasayfa?giris=ok');
	} else {
		header('location:../anasayfa=giris=no');
	}
}
yonlendirdiğin yerde giris=no alıp get ile alert verdirebilirsin.
                        
  