• 01-02-2010, 01:47:41
    #1
    Arkadaşlar error_log dosyamda aşağıdaki hataya rastlıyorum acaba bunun sebebi ve çözümü nedir?

    [01-Feb-2010 00:39:09] PHP Warning:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/tagsx.php on line 23
    Satır düzeni şu şekilde.

    21 $sql = "select tag from searchtagged where ID_TAG = ".$id."";
    22 $f = mysql_query($sql);
    23 $g = mysql_fetch_array($f);
    24 $current_tag_name = $g[0];
    25 $kelime1 = $current_tag_name;
    26 $current_tag_name = str_replace('+',' ',$current_tag_name);
  • 01-02-2010, 01:49:07
    #2
    Üyeliği durduruldu
    LeViS adlı üyeden alıntı: mesajı görüntüle
    Arkadaşlar error_log dosyamda aşağıdaki hataya rastlıyorum acaba bunun sebebi ve çözümü nedir?

    [01-Feb-2010 00:39:09] PHP Warning:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/tagsx.php on line 23
    Satır düzeni şu şekilde.

    21 $sql = "select tag from searchtagged where ID_TAG = ".$id."";
    22 $f = mysql_query($sql);
    23 $g = mysql_fetch_array($f);
    24 $current_tag_name = $g[0];
    25 $kelime1 = $current_tag_name;
    26 $current_tag_name = str_replace('+',' ',$current_tag_name);
    Hocam sQL İnjection Olabilir $id Değerine Filtreleme Yaptınız mı ? çünki sorguda hata var...
  • 01-02-2010, 02:02:06
    #3
    LeViS adlı üyeden alıntı: mesajı görüntüle
    21 $sql = "select tag from searchtagged where ID_TAG = ".$id."";
    $current_tag_name = $g[0];
    Alıntıladığım yerleri aşağıdakilerle değiştirip dener misiniz?
    $sql = "select tag from searchtagged where ID_TAG ='$id'";
    $current_tag_name = $g['tag'];
    Bir de hocam çok fazla değişken atayıp kod hamallığı yapmışsınız.
  • 01-02-2010, 03:59:17
    #4
    ilyasbat adlı üyeden alıntı: mesajı görüntüle
    Alıntıladığım yerleri aşağıdakilerle değiştirip dener misiniz?
    $sql = "select tag from searchtagged where ID_TAG ='$id'";
    $current_tag_name = $g['tag'];
    Bir de hocam çok fazla değişken atayıp kod hamallığı yapmışsınız.
    Verdiğiniz şekilde kaydettim. Hatalar sürekli olmadığı için hemen tesbit edemiyorum. Log dosyasını temizşedim yarın gün içerisinde tam sonuç belli olur sanırım.
  • 01-02-2010, 10:37:01
    #5
    Sanırım başka dosyalardada sorun var. Bunlarada el atarsanız çok memnun olurum arkadaşlar.

    [01-Feb-2010 07:06:51] PHP Warning:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/oyun.php on line 221
    Satırlar

    220 $a = mysql_query($sql);
    221 while ($v = mysql_fetch_array($a))
    222 {
  • 01-02-2010, 10:47:59
    #6
    Üyeliği durduruldu
    LeViS adlı üyeden alıntı: mesajı görüntüle
    Sanırım başka dosyalardada sorun var. Bunlarada el atarsanız çok memnun olurum arkadaşlar.

    [01-Feb-2010 07:06:51] PHP Warning:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/oyun.php on line 221
    Satırlar

    220 $a = mysql_query($sql);
    221 while ($v = mysql_fetch_array($a))
    222 {
    $sql a da ne var onuda yazarmısın
  • 01-02-2010, 11:33:45
    #7
    <div class="bottom-left-text-box"><p style="color:#F0F"><?=$oyun[$menu_isim_lower]?> <?=BENZEROYUNLAR?></p>
    <?
    $tm = explode(' ', $oyun[$menu_isim_lower]);
    if ($lang == 'TR' or $lang == 'EN' or $lang == 'DE' or $lang == 'ES')
    {
    if ($tm[0] and strlen($tm[0])>1) $sel = "LIKE '%".$tm[0]."%' ";
    if ($tm[1] and strlen($tm[1])>1) $sel .= " OR `".$menu_isim_lower."` LIKE '%".$tm[1]."%' ";
    if ($tm[2] and strlen($tm[2])>1) $sel .= " OR `".$menu_isim_lower."` LIKE '%".$tm[2]."%' ";
    $sql = "SELECT * FROM `oyun` WHERE `".$menu_isim_lower."` ".$sel." LIMIT 15 ";
    }
    else
    {
    if ($tm[0] and strlen($tm[0])>1) $sel = "LIKE '%".$tm[0]."%' ";
    if ($tm[1] and strlen($tm[1])>1) $sel .= " OR oyun_".strtolower($lang).".".$menu_isim_lower." LIKE '%".$tm[1]."%' ";
    if ($tm[2] and strlen($tm[2])>1) $sel .= " OR oyun_".strtolower($lang).".".$menu_isim_lower." LIKE '%".$tm[2]."%' ";
    $sql = "SELECT * FROM oyun, oyun_".strtolower($lang)." WHERE (oyun_".strtolower($lang).".".$menu_isim_lower." ".$sel.") and oyun.id = oyun_".strtolower($lang).".id LIMIT 15 ";
    }

    $i = 0;
    $style = 'style="margin-right:0px;"';

    $a = mysql_query($sql);
    while ($v = mysql_fetch_array($a))
    {
    ?>
    <a href="<?=FetchURL($v[$menu_isim_lower])?>.htm" title="<?=$v[$menu_isim_lower]?>"><?=$v[$menu_isim_lower]?></a>
    |

    <? }?>
    </div>
  • 02-02-2010, 20:15:05
    #8
    Arkadaşlar bir fikri olan yokmu acaba 221 ve 119. satırlar sürekli log dosyasını dolduruyor.


    [02-Feb-2010 18:57:07] PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/oyun.php on line 221
    [02-Feb-2010 19:05:05] PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/oyun.php on line 119



    <?
    if ($lang == 'TR' or $lang == 'EN' or $lang == 'DE' or $lang == 'ES') $sql = mysql_query("select * from oyun where menu = ".$current_menu_id." limit 7");
    else $sql = mysql_query("select * from oyun, oyun_".strtolower($lang)." where oyun.menu = ".$current_menu_id." and oyun.id = oyun_".strtolower($lang).".id limit 7");
    satır 119 while ($g = mysql_fetch_array($sql))
    {
    ?>



    <?
    $tm = explode(' ', $oyun[$menu_isim_lower]);
    if ($lang == 'TR' or $lang == 'EN' or $lang == 'DE' or $lang == 'ES')
    {
    if ($tm[0] and strlen($tm[0])>1) $sel = "LIKE '%".$tm[0]."%' ";
    if ($tm[1] and strlen($tm[1])>1) $sel .= " OR `".$menu_isim_lower."` LIKE '%".$tm[1]."%' ";
    if ($tm[2] and strlen($tm[2])>1) $sel .= " OR `".$menu_isim_lower."` LIKE '%".$tm[2]."%' ";
    $sql = "SELECT * FROM `oyun` WHERE `".$menu_isim_lower."` ".$sel." LIMIT 15 ";
    }
    else
    {
    if ($tm[0] and strlen($tm[0])>1) $sel = "LIKE '%".$tm[0]."%' ";
    if ($tm[1] and strlen($tm[1])>1) $sel .= " OR oyun_".strtolower($lang).".".$menu_isim_lower." LIKE '%".$tm[1]."%' ";
    if ($tm[2] and strlen($tm[2])>1) $sel .= " OR oyun_".strtolower($lang).".".$menu_isim_lower." LIKE '%".$tm[2]."%' ";
    $sql = "SELECT * FROM oyun, oyun_".strtolower($lang)." WHERE (oyun_".strtolower($lang).".".$menu_isim_lower." ".$sel.") and oyun.id = oyun_".strtolower($lang).".id LIMIT 15 ";
    }

    $i = 0;
    $style = 'style="margin-right:0px;"';

    $a = mysql_query($sql);
    Satır 221 while ($v = mysql_fetch_array($a))
    {
    ?>
  • 02-02-2010, 20:25:57
    #9
    Üyeliği durduruldu
    LeViS adlı üyeden alıntı: mesajı görüntüle
    Arkadaşlar bir fikri olan yokmu acaba 221 ve 119. satırlar sürekli log dosyasını dolduruyor.


    [02-Feb-2010 18:57:07] PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/oyun.php on line 221
    [02-Feb-2010 19:05:05] PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/oyun.php on line 119



    <?
    if ($lang == 'TR' or $lang == 'EN' or $lang == 'DE' or $lang == 'ES') $sql = mysql_query("select * from oyun where menu = ".$current_menu_id." limit 7");
    else $sql = mysql_query("select * from oyun, oyun_".strtolower($lang)." where oyun.menu = ".$current_menu_id." and oyun.id = oyun_".strtolower($lang).".id limit 7");
    satır 119 while ($g = mysql_fetch_array($sql))
    {
    ?>



    <?
    $tm = explode(' ', $oyun[$menu_isim_lower]);
    if ($lang == 'TR' or $lang == 'EN' or $lang == 'DE' or $lang == 'ES')
    {
    if ($tm[0] and strlen($tm[0])>1) $sel = "LIKE '%".$tm[0]."%' ";
    if ($tm[1] and strlen($tm[1])>1) $sel .= " OR `".$menu_isim_lower."` LIKE '%".$tm[1]."%' ";
    if ($tm[2] and strlen($tm[2])>1) $sel .= " OR `".$menu_isim_lower."` LIKE '%".$tm[2]."%' ";
    $sql = "SELECT * FROM `oyun` WHERE `".$menu_isim_lower."` ".$sel." LIMIT 15 ";
    }
    else
    {
    if ($tm[0] and strlen($tm[0])>1) $sel = "LIKE '%".$tm[0]."%' ";
    if ($tm[1] and strlen($tm[1])>1) $sel .= " OR oyun_".strtolower($lang).".".$menu_isim_lower." LIKE '%".$tm[1]."%' ";
    if ($tm[2] and strlen($tm[2])>1) $sel .= " OR oyun_".strtolower($lang).".".$menu_isim_lower." LIKE '%".$tm[2]."%' ";
    $sql = "SELECT * FROM oyun, oyun_".strtolower($lang)." WHERE (oyun_".strtolower($lang).".".$menu_isim_lower." ".$sel.") and oyun.id = oyun_".strtolower($lang).".id LIMIT 15 ";
    }

    $i = 0;
    $style = 'style="margin-right:0px;"';

    $a = mysql_query($sql);
    Satır 221 while ($v = mysql_fetch_array($a))
    {
    ?>

    Hocam DEdiğim Gibi Sorgularda Var Hata Bence SQL injection Saldırı Deniyorlar Filtreleme Varmı ?