RoKF0siC
Hectopat
- Katılım
- 14 Mayıs 2018
- Mesajlar
- 180
Başklıktaki hatayı veriyor XAMPP'te sorunsuz çalışıyor. Test için internette yayımlamak için ücretsiz bir Hosting'e yüklediğimde böyle bir hata veriyor. (kodlar Free open Source tam olarak ne yazdığını tam olarak bilmiyorum) veri tabanı bağlantılarında sorun yok ondan eminim. 75.satırda hata veriyor.
[CODE lang="php" highlight="75"]<?php
session_start();
if ($_SESSION && $_SESSION["Oturum"] != False) {
if($_SESSION['UserID']){
header('location: Sayfalar/Anasayfa.php');
}
} else {
$_SESSION["Oturum"] = False;
$_SESSION['Token'] = "";
require_once('../system/ayar.php');
require_once('../system/fonksiyon.php');
$user = GetInfo();
$ip = $user['ip'];
$hostadi = $user['hostadi'];
$proxy = $user['proxy'];
if ($_POST) {
$KullaniciAdi = p("KullaniciAdi");
$Sifre = sha1(md5(p("Sifre")));
$KullaniciAdi_log = $_POST['KullaniciAdi'];
$Sifre_log = $_POST['Sifre'];
if (empty($Sifre) or empty($KullaniciAdi)) {
$bilgi = 'Kullanıcı Adı & Şifre Boş Olamaz...';
$deger = 'info';
} else {
$sql = $db->prepare("SELECT * FROM kullanicilar WHERE 1=1 and IsActive=1 and KullaniciAdi=:KullaniciAdi AND Sifre = :Sifre");
$query = $db->query("SELECT * FROM kullanicilar WHERE 1=1 and IsActive=1 and KullaniciAdi='{$KullaniciAdi}' AND Sifre='{$Sifre}'")->fetch(PDO::FETCH_ASSOC);
$sql->bindparam(':KullaniciAdi', $KullaniciAdi, PDO:ARAM_STR);
$sql->bindparam(':Sifre', $Sifre, PDO:ARAM_INT);
$sql->execute();
if ($sql->rowCount()) {
$UserID = $query["UserID"];
$Yetki = $query["Yetki"];
$KullaniciAdi = $query["KullaniciAdi"];
$Sifre = $query["Sifre"];
$Adi = $query["Adi"];
$Soyadi = $query["Soyadi"];
$query = $db->prepare("INSERT INTO oturumtakip (basarili,ip,hostadi,proxy) VALUES (?,?,?,?)");
$query->execute(array(1,$ip,$hostadi,$proxy));
$query = $db->prepare('SELECT * FROM kullanicilar WHERE UserID=? AND IsActive=?');
$query->execute(array($UserID,1));
$row = $query->fetch(PDO::FETCH_ASSOC);
if ($row) {
$_SESSION['Token'] = md5($_SERVER['HTTP_USER_AGENT']."-Guvenlik");
$_SESSION["Oturum"] = TRUE;
$_SESSION["UserID"] = $UserID;
$_SESSION["KullaniciAdi"] = $KullaniciAdi;
$_SESSION["Sifre"] = $Sifre;
$_SESSION["Adi"] = $Adi;
$_SESSION["Soyadi"] = $Soyadi;
$_SESSION["Yetki"] = $Yetki;
if ($Yetki == "Admin") {
$bilgi = 'Admin Girişi Başarılı, Lütfen Bekleyiniz.';
$deger = 'success';
} else if ($Yetki == "Personel"){
$bilgi = 'Personel Girişi Başarılı, Lütfen Bekleyiniz.';
$deger = 'success';
} else {
$bilgi = 'Yetkisiz Giriş..!';
$deger = 'danger';
session_destroy();
header("refresh:5;url=index.php");
exit;
}
header("refresh:3;url=Sayfalar/Anasayfa.php");
}
} else {
$log = $db->prepare("INSERT INTO oturumtakip (password, username, ip, basarili,proxy,hostadi) VALUES (?,?,?,?,?,?)");
$log->execute(array($Sifre_log, $KullaniciAdi_log, $ip, 0, $proxy, $hostadi));
if ($log) {
$bilgi = ' Kullanıcı Adı Veya Şifre Hatalı.';
$deger = 'warning';
}
}
}
} else {
$bilgi = '';
}
?>[/CODE]
[CODE lang="php" highlight="75"]<?php
session_start();
if ($_SESSION && $_SESSION["Oturum"] != False) {
if($_SESSION['UserID']){
header('location: Sayfalar/Anasayfa.php');
}
} else {
$_SESSION["Oturum"] = False;
$_SESSION['Token'] = "";
require_once('../system/ayar.php');
require_once('../system/fonksiyon.php');
$user = GetInfo();
$ip = $user['ip'];
$hostadi = $user['hostadi'];
$proxy = $user['proxy'];
if ($_POST) {
$KullaniciAdi = p("KullaniciAdi");
$Sifre = sha1(md5(p("Sifre")));
$KullaniciAdi_log = $_POST['KullaniciAdi'];
$Sifre_log = $_POST['Sifre'];
if (empty($Sifre) or empty($KullaniciAdi)) {
$bilgi = 'Kullanıcı Adı & Şifre Boş Olamaz...';
$deger = 'info';
} else {
$sql = $db->prepare("SELECT * FROM kullanicilar WHERE 1=1 and IsActive=1 and KullaniciAdi=:KullaniciAdi AND Sifre = :Sifre");
$query = $db->query("SELECT * FROM kullanicilar WHERE 1=1 and IsActive=1 and KullaniciAdi='{$KullaniciAdi}' AND Sifre='{$Sifre}'")->fetch(PDO::FETCH_ASSOC);
$sql->bindparam(':KullaniciAdi', $KullaniciAdi, PDO:ARAM_STR);
$sql->bindparam(':Sifre', $Sifre, PDO:ARAM_INT);
$sql->execute();
if ($sql->rowCount()) {
$UserID = $query["UserID"];
$Yetki = $query["Yetki"];
$KullaniciAdi = $query["KullaniciAdi"];
$Sifre = $query["Sifre"];
$Adi = $query["Adi"];
$Soyadi = $query["Soyadi"];
$query = $db->prepare("INSERT INTO oturumtakip (basarili,ip,hostadi,proxy) VALUES (?,?,?,?)");
$query->execute(array(1,$ip,$hostadi,$proxy));
$query = $db->prepare('SELECT * FROM kullanicilar WHERE UserID=? AND IsActive=?');
$query->execute(array($UserID,1));
$row = $query->fetch(PDO::FETCH_ASSOC);
if ($row) {
$_SESSION['Token'] = md5($_SERVER['HTTP_USER_AGENT']."-Guvenlik");
$_SESSION["Oturum"] = TRUE;
$_SESSION["UserID"] = $UserID;
$_SESSION["KullaniciAdi"] = $KullaniciAdi;
$_SESSION["Sifre"] = $Sifre;
$_SESSION["Adi"] = $Adi;
$_SESSION["Soyadi"] = $Soyadi;
$_SESSION["Yetki"] = $Yetki;
if ($Yetki == "Admin") {
$bilgi = 'Admin Girişi Başarılı, Lütfen Bekleyiniz.';
$deger = 'success';
} else if ($Yetki == "Personel"){
$bilgi = 'Personel Girişi Başarılı, Lütfen Bekleyiniz.';
$deger = 'success';
} else {
$bilgi = 'Yetkisiz Giriş..!';
$deger = 'danger';
session_destroy();
header("refresh:5;url=index.php");
exit;
}
header("refresh:3;url=Sayfalar/Anasayfa.php");
}
} else {
$log = $db->prepare("INSERT INTO oturumtakip (password, username, ip, basarili,proxy,hostadi) VALUES (?,?,?,?,?,?)");
$log->execute(array($Sifre_log, $KullaniciAdi_log, $ip, 0, $proxy, $hostadi));
if ($log) {
$bilgi = ' Kullanıcı Adı Veya Şifre Hatalı.';
$deger = 'warning';
}
}
}
} else {
$bilgi = '';
}
?>[/CODE]