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

    +170

    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
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    $email = strip_tags($email);
    $email = str_replace("’", "", $email);
    $email = str_replace("(", "", $email);
    $email = str_replace(")", "", $email);
    $email = str_replace(";", "", $email);
    $email = str_replace(":", "", $email);
    $email = str_replace("<", "", $email);
    $email = str_replace("'", "", $email);
    $email = str_replace("UNION", "", $email);
    $email = str_replace("SELECT", "", $email);
    $email = str_replace("WHERE", "", $email);
    $email = str_replace("LIKE", "", $email);
    $email = str_replace("FROM”", "", $email);
    $email = str_replace("UPDATE", "", $email);
    $email = str_replace("INSERT", "", $email);
    $email = str_replace("ORDER", "", $email);
    $email = str_replace("GROUP", "", $email);
    $email = str_replace("ALTER", "", $email);
    $email = str_replace(" OR ", "", $email);
    $email = str_replace(" or ", "", $email);
    $email = str_replace("=", "", $email);
    
    $email1 = str_replace("’", "", $email1);
    $email1 = str_replace("(", "", $email1);
    $email1 = str_replace(")", "", $email1);
    $email1 = str_replace(";", "", $email1);
    $email1 = str_replace(":", "", $email1);
    $email1 = str_replace("<", "", $email1);
    $email1 = str_replace("'", "", $email1);
    $email1 = str_replace("UNION", "", $email1);
    $email1 = str_replace("SELECT", "", $email1);
    $email1 = str_replace("WHERE", "", $email1);
    $email1 = str_replace("LIKE", "", $email1);
    $email1 = str_replace("FROM”", "", $email1);
    $email1 = str_replace("UPDATE", "", $email1);
    $email1 = str_replace("INSERT", "", $email1);
    $email1 = str_replace("ORDER", "", $email1);
    $email1 = str_replace("GROUP", "", $email1);
    $email1 = str_replace("ALTER", "", $email1);
    $email1 = str_replace(" OR ", "", $email1);
    $email1 = str_replace(" or ", "", $email1);
    $email1 = str_replace("=", "", $email1);
    
    $location = str_replace("’", "", $location);
    $location = str_replace("(", "", $location);
    $location = str_replace(")", "", $location);
    $location = str_replace(";", "", $location);
    $location = str_replace(":", "", $location);
    $location = str_replace("<", "", $location);
    $location = str_replace("'", "", $location);
    $location = str_replace("UNION", "", $location);
    $location = str_replace("SELECT", "", $location);
    $location = str_replace("WHERE", "", $location);
    $location = str_replace("LIKE", "", $location);
    $location = str_replace("FROM”", "", $location);
    $location = str_replace("UPDATE", "", $location);
    $location = str_replace("INSERT", "", $location);
    $location = str_replace("ORDER", "", $location);
    $location = str_replace("GROUP", "", $location);
    $location = str_replace("ALTER", "", $location);
    $location = str_replace(" OR ", "", $location);
    $location = str_replace(" or ", "", $location);
    $location = str_replace("=", "", $location);
    
    $cinsiyet = str_replace("’", "", $cinsiyet);
    $cinsiyet = str_replace("(", "", $cinsiyet);
    $cinsiyet = str_replace(")", "", $cinsiyet);
    $cinsiyet = str_replace(";", "", $cinsiyet);
    $cinsiyet = str_replace(":", "", $cinsiyet);
    $cinsiyet = str_replace("<", "", $cinsiyet);
    $cinsiyet = str_replace("'", "", $cinsiyet);
    $cinsiyet = str_replace("UNION", "", $cinsiyet);
    $cinsiyet = str_replace("SELECT", "", $cinsiyet);
    $cinsiyet = str_replace("WHERE", "", $cinsiyet);
    $cinsiyet = str_replace("LIKE", "", $cinsiyet);
    $cinsiyet = str_replace("FROM”", "", $cinsiyet);
    $cinsiyet = str_replace("UPDATE", "", $cinsiyet);
    $cinsiyet = str_replace("INSERT", "", $cinsiyet);
    $cinsiyet = str_replace("ORDER", "", $cinsiyet);
    $cinsiyet = str_replace("GROUP", "", $cinsiyet);
    $cinsiyet = str_replace("ALTER", "", $cinsiyet);
    $cinsiyet = str_replace(" OR ", "", $cinsiyet);
    $cinsiyet = str_replace(" or ", "", $cinsiyet);
    $cinsiyet = str_replace("=", "", $cinsiyet);

    Большой проект. Часть переменных на турецком. Смесь из php с html. Файлы проекта сохранены в разных кодировках. Mysql конфиги иногда подключаются include'ом, иногда прямо в текущем файле.

    zorbis, 20 Сентября 2011

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

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    if($total>1) {
        Error_Reporting(E_ALL & ~E_NOTICE);
        echo "<tr><td colspan='4'><div align='center'> <br />";
        echo $pervpage.$page5left.$page4left.$page3left.$page2left.$page1left.'<b>'.$p.'</b>'.$page1right.$page2right.$page3right.$page4right.$page5right.$nextpage;
        echo "</div></tr></td>";
    }

    И это все к конце скрипта

    cephuo, 19 Сентября 2011

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

    +146

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    <?php
    
    error_reporting(E_ALL);
    
    require_once '../app/config.php';
    require_once systemConfig::$pathToSystem . '/index.php';
    require_once '../app/application.php';
    
    $application = new application();
    $application->run();
    
    ?>

    http://code.google.com/p/govnokod/source/browse/trunk/govnoquoter/www/index.php
    Шел 2011-й год...

    alexoy, 18 Сентября 2011

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

    +165

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    <tr>
            <?php if (cmsCountModules("left")) { ?>
               <td><?php cmsModule("left"); ?></td>
            <?php } ?>
           <?php if (cmsCountModules("top")) { ?>
               <td><?php cmsModule("top"); ?></td>
           <?php } ?>    
           <?php if (cmsCountModules("right")) { ?>
               <td><?php cmsModule("right"); ?></td>
           <?php } ?>
         </tr>

    Здравствуй ГК!
    Сегодня я печалюсь про похапэ.

    da4ever, 18 Сентября 2011

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

    +165

    1. 1
    $sExt = file_exists("files/" . $sId . ".flv") ? "m4v" : "flv";

    Вот с такой проверкой столкнулся работая над воспроизведением видео.
    Лишний раз доказывает очень высокопрофессиональный уровень программистов из Пакистана, которые работали над проектом до меня :)

    Hits, 17 Сентября 2011

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

    +159

    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
    // Функция создания списка страниц типа << < 1 2 3 > >>
    function PageBar($adsNum, $nowPage, $currUrl){
    
    	$maxpageinHalf = intval (MAX_PAGEIN / 2);
    	$maxpagein = MAX_PAGEIN;
    	$maxresults = MAX_RESULTS;
    	$pn=($adsNum%MAX_RESULTS!=0);
    	$pageNum = intval($adsNum / $maxresults) + $pn;
    	$pageNum==0?$pageNum=1:"";
    	
    	if ($nowPage < $maxpageinHalf ){ // определение первой половины списка страниц.
    	 $minPage = 0;
    	 $maxPage = $maxpagein;
    	 ($maxPage>$pageNum)?$maxPage=$pageNum:"";
    	 $previous10Page = 0;
    	 $next10Page = $nowPage + $maxpagein;
    	}
    		elseif ($nowPage > $pageNum - $maxpageinHalf) {
    		 $maxPage = $pageNum;
    		 $minPage = $pageNum - $maxpagein;
    		 ($minPage<=0)?$minPage=0:"";
    		 $previous10Page = $nowPage - $maxpageinHalf;
    		 $next10Page = $pageNum;
    		}
    	else {
    	 $minPage = $nowPage - $maxpageinHalf;
    	 $maxPage = $nowPage + $maxpageinHalf;
    	 $previous10Page = $nowPage - $maxpagein;
    	 $next10Page = $nowPage + $maxpagein;
    	}
    	
    	$next10Page >= $pageNum? $next10Page = $pageNum-1:"";	
    
    	$listing = "<a href='p0,a,".$currUrl."' title=\"В начало\" class=\"ads-link1\">|<<</a>&nbsp;&nbsp;";
    	$listing .= "<a href='p$previous10Page,a,".$currUrl."' title=\"Предыдущие $maxpagein страниц\" class=\"ads-link1\"><</a>&nbsp;&nbsp;";
    
    	for ( $i = $minPage; $i < $maxPage; $i++) {
    		if ( $i == $nowPage )
    			$listing .= "<span style=\"font-size:16px; color:red;\">".($i+1)."</span>&nbsp;";
    		else
    			$listing .= "<a href=\"p".$i.",a,".$currUrl."\" title=\"Страница ".($i+1)."/$pageNum\" class=\"ads-link1\">".($i+1)."</a>&nbsp;";
    			
    		
    	}
    
    	$listing .= "&nbsp;&nbsp;<a href='p".($next10Page).",a,".$currUrl."' title=\"Следующие $maxpagein страниц\" class=\"ads-link1\">></a>&nbsp;&nbsp;";
    	$listing .= "<a href='p".($pageNum-1).",a,".$currUrl."' title=\"В конец\" class=\"ads-link1\">>>|</a>";
    
    return $listing;
    }

    Два дня ебался, но чувствую, что здесь что-то не то :D

    Alkonost, 17 Сентября 2011

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

    +145

    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
    <?php
    
    header('Content-Type: text/html; charset=utf-8');
    
    function даешь_кириллицу_блеать($оказывается_можно_и_так_0_о) {
        echo $оказывается_можно_и_так_0_о;
    }
    
    даешь_кириллицу_блеать('век живи');
    
    $хуй=' - век учись';
    echo $хуй;
    
    
    ?>

    я кирпичами сру, ОНО РАБОТАЕТ!!!!!

    jokz, 17 Сентября 2011

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

    +156

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $c = (int)(bool)$_POST['chat'];
    
    // через сто строк
    
    $q = 'UPDATE ....., `chat`='.$c.' WHERE ....';

    интригующе

    jokz, 16 Сентября 2011

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

    +36

    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
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    function utf8win ($strin)  {
    	$strin = ereg_replace("&#x0430;","а",$strin);
    	$strin = ereg_replace("&#x0431;","б",$strin);
    	$strin = ereg_replace("&#x0432;","в",$strin);
    	$strin = ereg_replace("&#x0433;","г",$strin);
    	$strin = ereg_replace("&#x0434;","д",$strin);
    	$strin = ereg_replace("&#x0435;","е",$strin);
    	$strin = ereg_replace("&#x0451;","ё",$strin);
    	$strin = ereg_replace("&#x0436;","ж",$strin);
    	$strin = ereg_replace("&#x0437;","з",$strin);
    	$strin = ereg_replace("&#x0438;","и",$strin);
    	$strin = ereg_replace("&#x0439;","й",$strin);
    	$strin = ereg_replace("&#x043A;","к",$strin);
    	$strin = ereg_replace("&#x043B;","л",$strin);
    	$strin = ereg_replace("&#x043C;","м",$strin);
    	$strin = ereg_replace("&#x043D;","н",$strin);
    	$strin = ereg_replace("&#x043E;","о",$strin);
    	$strin = ereg_replace("&#x043F;","п",$strin);
    	$strin = ereg_replace("&#x0440;","р",$strin);
    	$strin = ereg_replace("&#x0441;","с",$strin);
    	$strin = ereg_replace("&#x0442;","т",$strin);
    	$strin = ereg_replace("&#x0443;","у",$strin);
    	$strin = ereg_replace("&#x0444;","ф",$strin);
    	$strin = ereg_replace("&#x0445;","х",$strin);
    	$strin = ereg_replace("&#x0446;","ц",$strin);
    	$strin = ereg_replace("&#x0448;","ш",$strin);
    	$strin = ereg_replace("&#x0449;","щ",$strin);
    	$strin = ereg_replace("&#x044A;","ъ",$strin);
    	$strin = ereg_replace("&#x044C;","ь",$strin);
    	$strin = ereg_replace("&#x044D;","э",$strin);
    	$strin = ereg_replace("&#x044E;","ю",$strin);
    	$strin = ereg_replace("&#x044F;","я",$strin);
    	$strin = ereg_replace("&#x0447;","ч",$strin);
    	$strin = ereg_replace("&#x044B;","ы",$strin);
    	$strin = ereg_replace("&#x0410;","А",$strin);
    	$strin = ereg_replace("&#x0411;","Б",$strin);
    	$strin = ereg_replace("&#x0412;","В",$strin);
    	$strin = ereg_replace("&#x0413;","Г",$strin);
    	$strin = ereg_replace("&#x0414;","Д",$strin);
    	$strin = ereg_replace("&#x0415;","Е",$strin);
    	$strin = ereg_replace("&#x0416;","Ж",$strin);
    	$strin = ereg_replace("&#x0417;","З",$strin);
    	$strin = ereg_replace("&#x0418;","И",$strin);
    	$strin = ereg_replace("&#x0419;","Й",$strin);
    	$strin = ereg_replace("&#x041A;","К",$strin);
    	$strin = ereg_replace("&#x041B;","Л",$strin);
    	$strin = ereg_replace("&#x041C;","М",$strin);
    	$strin = ereg_replace("&#x041D;","Н",$strin);
    	$strin = ereg_replace("&#x041E;","О",$strin);
    	$strin = ereg_replace("&#x041F;","П",$strin);
    	$strin = ereg_replace("&#x0420;","Р",$strin);
    	$strin = ereg_replace("&#x0421;","С",$strin);
    	$strin = ereg_replace("&#x0422;","Т",$strin);
    	$strin = ereg_replace("&#x0423;","У",$strin);
    	$strin = ereg_replace("&#x0424;","Ф",$strin);
    	$strin = ereg_replace("&#x0425;","Х",$strin);
    	$strin = ereg_replace("&#x0426;","Ц",$strin);
    	$strin = ereg_replace("&#x0428;","Ш",$strin);
    	$strin = ereg_replace("&#x0429;","Щ",$strin);
    	$strin = ereg_replace("&#x042A;","Ъ",$strin);
    	$strin = ereg_replace("&#x042C;","Ь",$strin);
    	$strin = ereg_replace("&#x042D;","Э",$strin);
    	$strin = ereg_replace("&#x042E;","Ю",$strin);
    	$strin = ereg_replace("&#x042F;","Я",$strin);
    	$strin = ereg_replace("&#x0427;","Ч",$strin);
    	$strin = ereg_replace("&#x042B;","Ы",$strin);
    	$strin = ereg_replace("&#x041;","Ё",$strin);
    	return $strin;
    }

    brainstorm, 16 Сентября 2011

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

    +167

    1. 1
    2. 2
    3. 3
    function js(){
       Header("Location: ../www/basket.php");
    }

    temka, 16 Сентября 2011

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