• 01-02-2024, 22:29:36
    #1
    Evet Arkadaşlar Bir Scriptimde Kullandığım login scriptimle ilgili cpanelin php 8.0 altı versiyonları kaldırmasından sonra aldığım hatalar var...
    bilgim biraz kısıtlı kolay çözülebilecek bişeymi bi bakarmısınız ?

    aldığım hatalar ve ilgili yerdeki kodlar

    Notice: Undefined variable: _SESSION in /home/katalog/public_html/header.php on line 311
    Notice: Trying to access array offset on value of type null in /home/katalog/public_html/header.php on line 311
    
    <?php if(userValue($_SESSION['uid'], "avatar") == "") { ?>
    
    --------------------------------------------------------------------------------------------------------------------------
    
    Notice: Undefined variable: _SESSION in /home/katalog/public_html/header.php on line 343
    Notice: Trying to access array offset on value of type null in /home/katalog/public_html/header.php on line 343
    
    <?php if(userValue($_SESSION['uid'], "adsoyad") == "") { ?>
    
    -----------------------------------------------------------------------------------------------------------------------------
    
    Notice: Trying to access array offset on value of type null in /home/katalog/public_html/login/includes/api.php on line 252
    
    // Function to check if a user has one of the specified levels
    function is_allowedLevel($levels) {
        global $con;
        
        $uid = mysqli_real_escape_string($con, $_SESSION['uid']);
        $getuser = mysqli_query($con,"SELECT * FROM login_users WHERE id='$uid'");
        $gu = mysqli_fetch_array($getuser);
        
        $permid = $gu['permission'];
        $gperm = mysqli_query($con,"SELECT * FROM login_permissions WHERE id='$permid'");
        $gp = mysqli_fetch_array($gperm);
        
    (252)    $level = explode(",", $levels); // Separate the levels FROM login_the commas
        
        $found = 0;
        // Check if the user has one of the specified levels
        foreach($level as $l) {
            $l = trim($l);
            if($l == $gp['level']) {
                $found++; // Count 1 to $found if the levels match
            }
        }
        
        // If user does not have one of the specified level the function returns false
        if($found == 0) {
            return false;
        } else {
            return true;
        }
    }
    -----------------------------------------------------------------------------------------------------
  • 01-02-2024, 22:35:00
    #2
    öyle sürümleri kaldıramazlar tak diye kaldırdıysalar başka firma tercih edin çünkü çalışmaz scriptüniz
  • 01-02-2024, 22:40:20
    #3
    Hata veren dosyaların başına şu kodları ekleyip deneyebilir misiniz?
    ob_start();
    session_start();
  • 01-02-2024, 22:48:51
    #4
    bagbaq adlı üyeden alıntı: mesajı görüntüle
    Hata veren dosyaların başına şu kodları ekleyip deneyebilir misiniz?
    ob_start();
    session_start();
    Bunu Denedim... aynı scripti iki ayrı firmanın hostinginde kurulu..
    bir tanesinde bu kodu kullanınca kısmen faydası oldu... login girişi yapılmadan önce hatalar görünüyor login olunca hatalar kayboluyor...
    diğerinde ise hiç bir işe yaramadı..
  • 01-02-2024, 23:16:04
    #5
    alemextra adlı üyeden alıntı: mesajı görüntüle
    Bunu Denedim... aynı scripti iki ayrı firmanın hostinginde kurulu..
    bir tanesinde bu kodu kullanınca kısmen faydası oldu... login girişi yapılmadan önce hatalar görünüyor login olunca hatalar kayboluyor...
    diğerinde ise hiç bir işe yaramadı..
    Diğer hostingde error_log dosyası oluşuyorsa buraya atabilir misiniz
  • 01-02-2024, 23:17:03
    #6
    İlgili kodlar az ise PHP 8.0 sürümüne update yapılması daha faydalı.
  • 01-02-2024, 23:23:56
    #7
    bagbaq adlı üyeden alıntı: mesajı görüntüle
    Diğer hostingde error_log dosyası oluşuyorsa buraya atabilir misiniz
    baya yoğun...
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/index.php on line 78
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/index.php on line 78
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Warning:  session_start(): Cannot start session when headers already sent in /home/katalog/public_html/header.php on line 3
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/header.php on line 147
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/header.php on line 147
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/login/includes/api.php on line 238
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/login/includes/api.php on line 238
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/login/includes/api.php on line 242
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/login/includes/api.php on line 252
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/header.php on line 314
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/header.php on line 314
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/header.php on line 346
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/header.php on line 346
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/login/includes/api.php on line 238
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/login/includes/api.php on line 238
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/login/includes/api.php on line 242
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/login/includes/api.php on line 252
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/header.php on line 582
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/header.php on line 582
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/panel.php on line 74
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/panel.php on line 74
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Warning:  session_start(): Cannot start session when headers already sent in /home/katalog/public_html/header.php on line 3
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/header.php on line 147
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/header.php on line 147
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/login/includes/api.php on line 238
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/login/includes/api.php on line 238
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/login/includes/api.php on line 242
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/login/includes/api.php on line 252
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/header.php on line 314
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/header.php on line 314
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/header.php on line 346
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Trying to access array offset on value of type null in /home/katalog/public_html/header.php on line 346
    [01-Feb-2024 23:20:12 Europe/Istanbul] PHP Notice:  Undefined variable: _SESSION in /home/katalog/public_html/login/includes/api.php on line 238
  • 01-02-2024, 23:25:12
    #8
    PATRON54 adlı üyeden alıntı: mesajı görüntüle
    İlgili kodlar az ise PHP 8.0 sürümüne update yapılması daha faydalı.
    evet sanırım elden geçmesi gerekiyor... çok cıkabilir.. ama mantığı kavrayabilsem sorun heryerde aynı sanırım..
    yavaş yavaş çözerim..

    Hatalar genelde bu kodun oldugu yer...
    <?php if(userValue($_SESSION['uid'], "adsoyad") == "") { ?>
  • 01-02-2024, 23:32:18
    #9
    alemextra adlı üyeden alıntı: mesajı görüntüle
    evet sanırım elden geçmesi gerekiyor... çok cıkabilir.. ama mantığı kavrayabilsem sorun heryerde aynı sanırım..
    yavaş yavaş çözerim..

    Hatalar genelde bu kodun oldugu yer...
    <?php if(userValue($_SESSION['uid'], "adsoyad") == "") { ?>
    Bunu dener misin.

    <?php if (empty(userValue($_SESSION['uid'], "adsoyad"))) { ?>