• 07-04-2021, 18:11:25
    #1
    <?php


    include '/baglanti.php';

    $a = $_SERVER['HTTP_REFERER'] ?? null;

    if (strpos($a, 'http://www.xxxxxxxx.com/') !== false) { ---------> bundan birden fazla nasıl ekleyebilirim arkadaşlar 3 4 site eklemek istiyorum mesala

    $player_seo = $_GET['yayin_seo'];

    $bilgilerimsor=$db->prepare("SELECT * from player WHERE player_seo='$player_seo'");

    $bilgilerimsor->execute();

    $bilgilerimcek=$bilgilerimsor->fetch(PDO::FETCH_ASSOC);

    ?>
  • 07-04-2021, 18:13:56
    #2
    siteleri bir array de tutup if içinde in_array($a, $array) şeklinde bir sorgulama yapabilirsin.
  • 07-04-2021, 18:17:56
    #3
    sekman adlı üyeden alıntı: mesajı görüntüle
    <?php


    include '/baglanti.php';

    $a = $_SERVER['HTTP_REFERER'] ?? null;

    if (strpos($a, 'http://www.xxxxxxxx.com/') !== false) { ---------> bundan birden fazla nasıl ekleyebilirim arkadaşlar 3 4 site eklemek istiyorum mesala

    $player_seo = $_GET['yayin_seo'];

    $bilgilerimsor=$db->prepare("SELECT * from player WHERE player_seo='$player_seo'");

    $bilgilerimsor->execute();

    $bilgilerimcek=$bilgilerimsor->fetch(PDO::FETCH_ASSOC);

    ?>
    Bunu iki yöntemle yapabilirsin.

    1. Veya Operatörü ile

    if (strpos($a, 'http://www.xxxxxxxx.com/') !== false || strpos($a, 'http://www.aaaaaa.com/') !== false || strpos($a, 'http://www.bbbb.com/') !== false) {
    // Codes
    }
    2. Url Parse sadece domaini array içerisinde arama:

    $a = parse_url($a);
    
    if(in_array($a['host'], ['aaaa.com', 'bbbb.com', 'cccc.com'])){
    // Codes
    }
  • 07-04-2021, 18:26:28
    #4
    batuhan_polat adlı üyeden alıntı: mesajı görüntüle
    Bunu iki yöntemle yapabilirsin.

    1. Veya Operatörü ile

    if (strpos($a, 'http://www.xxxxxxxx.com/') !== false || strpos($a, 'http://www.aaaaaa.com/') !== false || strpos($a, 'http://www.bbbb.com/') !== false) {
    // Codes
    }
    2. Url Parse sadece domaini array içerisinde arama:

    $a = parse_url($a);
    
    if(in_array($a['host'], ['aaaa.com', 'bbbb.com', 'cccc.com'])){
    // Codes
    }
    teşekkür ederim hocam çok sağol çalıştı