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

    +158

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    $pus=$HTTP_COOKIE_VARS["par"];
    $sqlru="select * from users where login='$pus'";
    $resultru=mysql_query($sqlru);
    $rowru=mysql_fetch_array($resultru);
    if ($pus==$rowru[1] && $pus<>"")
    {
    $sqlp="INSERT INTO partner VALUES('$pus','$r_login','$date','0.00')";
    mysql_query($sqlp);
    }

    Alexion, 18 Августа 2009

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

    +164.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
    /**
    function.php
    */
    function result($selected, $sources, $date_from, $date_till, $step)
    {
      $ret = $header = array();
      if (is_array($selected) and count($selected))
      {
        foreach ($selected as $item=>$value)
        {
          if ('on' == $value)
          {
            $header[$item] = $sources[$item]['name'];
            if (isset($sources[$item]['db_host']))
            {
              // external db
              class DB_EXT extends DB
              {
    .......

    объявление класса внутри цикла внутри функции!!
    рыдааййууу

    shitcoder, 18 Августа 2009

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

    +161.1

    1. 1
    2. 2
    3. 3
    4. 4
    $w="";
    foreach(array("id_page","id_point","id") as $i)
    $w.=$$i?(($w?" and ":"")."$i=".$$i):"";
    $sql="select * from ".$this->_name." where $w order by ordr,ts desc";

    и без комментов, ага.

    voblasoul, 18 Августа 2009

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

    +166.4

    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
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    <?
    $query="SELECT * FROM Communicators WHERE phoneID=$phoneID";
    $dba->query($query);
    list($phoneID, $brandID, $phoneModel, $phoneDate, $phonePriceRetail, $phonePriceWS,$phonePriceWS1, $phoneDescrShort, $phoneDescrFull, $phonePicShort, $phonePicFull,
    $phonePriceWSComment, $groupDefaultprice1, $groupDefaultprice2, $groupGroup2price1, $groupGroup2price2, $grouptempprice1, $grouptempprice2, $groupGorodprice1, $groupGorodprice2, $groupClientsprice1, $groupClientsprice2,
    $standards, $height, $width, $thickness, $weight, $batteryType, $batteryMAH, $standbyTime, $talkTime, $phoneBookSize, $video, $processor, $calendar, $wap, $OS, $GPRS, $EDGE, $java, $FMradio, $memcard, $bluetooth, $modem, $irda, $EMS, $MMS, $USB, $dictaphone, $camera, $colorDisplay, $twoDisplays, $outlookSynchro, $otherDescription, $games, $ringFileFormat, $innerMemory, $mp3player, $corpus, $WiFi, $videoCall, $GPS, $xtraDescr, $id_article)=$dba->get_row();
    ?>
    <h2>Описание <?=$brandName?> <?=$phoneModel?></h2>
    <b>Основные характеристики</b><br>
    <?if( $standards != "" ){?>Стандарт: <?=$standards?><br><?}?>
    <?if( $corpus != "" ){?>Тип корпуса: <?=$corpus?><br><?}?>
    Размеры, мм (Ш×В×Г): <?=$width?>×<?=$height?>×<?=$thickness?><br>
    <?if( $weight != "" ){?>Вес: <?=$weight?> г<br><?}?>
    Аккумулятор: <?if( $batteryType != "" ){?><?=$batteryType?>, <?}?><?if( $batteryMAH != "" ){?><?=$batteryMAH?> мА·ч<br><?}?>
    <?if( $processor != "" ){?>Процессор: <?=$processor?><br><?}?>
    <?if( ($innerMemory != "0") && ($innerMemory != 0) && ($innerMemory != "") ){?>Память RAM/ROM: <?=$innerMemory?><br><?}?>
    <?if( $memcard != "" ){?>Слоты расширения: <?=str_replace("+","есть",str_replace("-","нет",$memcard))?><br><?}?>
    <?if( $OS != "" ){?>Операционная система: <?=$OS?><br><?}?>
    <?if( $calendar != "" ){?>Органайзер: <?=str_replace("+","есть",str_replace("-","нет",$calendar))?><br><?}?>
    <br>
    <b>Связь</b><br>
    <?if( $USB != "" ){?>USB: <?=str_replace("+","есть",str_replace("-","нет",$USB))?><br><?}?>
    <?if( $irda != "" ){?>Инфракрасный порт: <?=str_replace("+","есть",str_replace("-","нет",$irda))?><br><?}?>
    <?if( $GPRS != "" ){?>GPRS: <?=str_replace("+","есть",str_replace("-","нет",$GPRS))?><br><?}?>
    <?if( $EDGE != "" ){?>EDGE: <?=str_replace("+","есть",str_replace("-","нет",$EDGE))?><br><?}?>
    <?if( $bluetooth != "" ){?>Bluetooth: <?=str_replace("+","есть",str_replace("-","нет",$bluetooth))?><br><?}?>
    <?if( $WiFi != "" ){?>Wi-Fi: <?=str_replace("+","есть",str_replace("-","нет",$WiFi))?><br><?}?>
    <?if( $GPS != "" ){?>GPS: <?=str_replace("+","есть",str_replace("-","нет",$GPS))?><br><?}?>
    <br>
    <b>Экран</b><br>
    <?if( $colorDisplay != "" ){?>Экран: <?=str_replace("+","есть",str_replace("-","нет",$colorDisplay))?><br><?}?>
    <?if( $twoDisplays != "" ){?>Сенсорный дисплей: <?=str_replace("+","есть",str_replace("-","нет",$twoDisplays))?><br><?}?>
    <br>
    <b>Мультимедийные возможности</b><br>
    <?if( $mp3player != "" ){?>MP3-плеер: <?=str_replace("+","есть",str_replace("-","нет",$mp3player))?><br><?}?>
    <?if( $ringFileFormat != "" ){?>Аудио форматы: <?=$ringFileFormat?><br><?}?>
    <?if( $FMradio != "" ){?>FM радио: <?=str_replace("+","есть",str_replace("-","нет",$FMradio))?><br><?}?>
    <?if( $dictaphone != "" ){?>Диктофон: <?=str_replace("+","есть",str_replace("-","нет",$dictaphone))?><br><?}?>
    <?if( $camera != "" ){?>Камера: <?=str_replace("+","есть",str_replace("-","нет",$camera))?><br><?}?>
    <?if( $video != "" ){?>Съемка видео: <?=str_replace("+","есть",str_replace("-","нет",$video))?><br><?}?>
    <?if( $videoCall != "" ){?>Видеозвонок: <?=str_replace("+","есть",str_replace("-","нет",$videoCall))?><br><?}?>
    <?if( $games != "" ){?>Игры: <?=str_replace("+","есть",str_replace("-","нет",$games))?><br><?}?>
    <?if( $otherDescription != "" ){?>
    <br>
    <b>Прочее</b><br>
    <?=nl2br($otherDescription)?>
    <?}?>

    Разгребаю это говно... Тот кто так пишет - недостоин жить :(

    Yozheg, 17 Августа 2009

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

    +148

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    if(mysql_num_rows($records_sql)<1){
    		$_SESSION['site_msg']='no_user_found';
    		header('Location: customer_listing.php');
    		echo '<script type="text/javascript">';
    		echo 'window.location.href="customer_listing.php";';
    		echo '</script>';
    		echo '<noscript>';
    		echo '<meta http-equiv="refresh" content="0;url=customer_listing.php" />';
    		echo '</noscript>'; 
    		exit();
    	}

    чтоб наверняка

    rusk, 17 Августа 2009

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

    +162.2

    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
    $r_fam = str_replace(',',"",$r_fam);
    $r_fam = str_replace('$',"",$r_fam);
    $r_fam = str_replace('\"',"",$r_fam);
    $r_fam = str_replace('<',"",$r_fam);
    $r_fam = str_replace('>',"",$r_fam);
    $r_fam = str_replace('*',"",$r_fam);
    $r_fam = str_replace('=',"",$r_fam);
    
    
    $r_name = str_replace(',',"",$r_name);
    $r_name = str_replace('$',"",$r_name);
    $r_name = str_replace('\"',"",$r_name);
    $r_name = str_replace('<',"",$r_name);
    $r_name = str_replace('>',"",$r_name);
    $r_name = str_replace('*',"",$r_name);
    $r_name = str_replace('=',"",$r_name);
    
    $sqlr="INSERT INTO users VALUES(NULL,'$r_login','$r_pass','0.00','0.00','0.00','$r_email','$r_name','$r_fam','$date','0.00')";
    mysql_query($sqlr);

    Защита в лоб.
    register_globals = on

    Alexion, 17 Августа 2009

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

    +147.8

    1. 1
    2. 2
    3. 3
    4. 4
    if ($i++%2==0)
            $bgc='#eeeeee';
        else
            $bgc='#cccccc';

    Самое интересное, что инкремент производится после прохождения проверки

    p0dl0m, 17 Августа 2009

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

    +153

    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
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    function strum($text, $simb)
    {
    if(mb_strlen($text, 'UTF-8') > $simb){
    
    }
    if(mb_strlen($text, 'UTF-8') > $simb)
      {
    	$start = 0;
    	for($i = 0; $i <= (ceil(mb_strlen($text, 'UTF-8') / $simb)); $i++)
    	{
    
    		$tmp = mb_strpos($text, '. ', $start + $simb, 'UTF-8');
    		if(is_numeric($tmp))
    		{
    			$num[] = $tmp;
    
    		}
    		$tmp = mb_strpos($text, '! ', $start  + $simb, 'UTF-8');
    				if(is_numeric($tmp))
    		{
    			$num[] = $tmp;
    
    		}
    		$tmp = mb_strpos($text, '? ', $start  + $simb, 'UTF-8');
    				if(is_numeric($tmp))
    		{
    			$num[] = $tmp;
    
    		}
    		if($num != '')
    		{
    		$end = min($num) + 1;
    		}
    		if($end <= $start)
    		{
    			$end = mb_strlen($text, 'UTF-8');
    		}
    		$str = mb_substr($text, $start, $end, 'UTF-8');
    		$string[] = mb_substr($str, 0, ($end - $start), 'UTF-8');
    
    	$start = $end;
    	unset($num);
    	unset($str);
    	unset($tmp);
    	if($end == mb_strlen($text, 'UTF-8'))
    		{
    			break;
    		}
    	}
      }
      else
      {
      $string[] = $text;
      }
      return $string;
    
    }

    Функция для умной разбивки

    Arrim, 15 Августа 2009

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

    +153

    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
    <?php
    $thelist = array();
    $dir = './upload/ftp/';
    if ($handle = opendir($dir)) {
    	while (false !== ($file = readdir($handle))) {
    		if ($file != "." && $file != ".." && $file !="index.php" && $file !=".ftpquota") {
    			$file = $file;
    			$thelist[] = array('file' => $file, 'filemtime' => filemtime($file), 'filesize' => filesize($file));
    		}
    	}
    
    	closedir($handle);
    }
    ?>
    <?php
    for($i = 0; $i < count($thelist); $i++) {
    	?><a href="sitename/<?=$thelist[$i]['file']?>"><?=$thelist[$i]['file']?></a><?php
    }
    ?>

    scrat, 14 Августа 2009

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

    +156

    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
    <?
    $i=$var = null;
    
    function NullPointerShare(&$vv)
    {
    
    for (;;)
    {
        $i=$vv;
    $i++;
    
    
        if ($i==20)
        {
            $i=null;
                die (NullPointerShare($i));
    
        }else if ($i<20){
    $ix=19;
     die (NullPointerShare($ix));
    	}
    }
    return $vv;
    
    }
    
    die ("--> ".NullPointerShare($var));
    ?>

    Без коментов:)

    notrade, 14 Августа 2009

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