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

    +193

    1. 1
    2. 2
    3. 3
    if (md5(__FILE__) != '411606f6b8bcb6ac950c69567e840f44') {
    	die('Файл взломан.');
    }

    Барон Мюнхгаузен.

    Reyni, 09 Августа 2011

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

    +163

    1. 1
    <div class="highslide-container" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-color: currentColor; border-left-color: currentColor; border-right-color: currentColor; border-bottom-color: currentColor; border-top-width: medium; border-left-width: medium; border-right-width: medium; border-bottom-width: medium; border-top-style: none; border-left-style: none; border-right-style: none; border-bottom-style: none; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; position: absolute; left: 0px; top: 0px; width: 100%; z-index: 1001; direction: ltr">

    Попросили помочь с темлейтой в DLE хз какой версии

    tagrim, 08 Августа 2011

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

    +177

    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
    <?PHP 
    /*
     *This Function Is programed By MR-O
     *The first arabic Function for crypting
    */
    function abo($variable){ 
    $variable =str_replace("1",1 ^ 52 ,$variable);
    $variable =str_replace("2",2 ^ 5 ,$variable);
    $variable =str_replace("3",3 ^ 8 ,$variable);
    $variable =str_replace("4",4 ^ 18 ,$variable);
    $variable =str_replace("5",5 ^ 30 ,$variable);
    $variable =str_replace("6",6 ^ 42 ,$variable);
    $variable =str_replace("7",7 ^ 26 ,$variable);
    $variable =str_replace("8",8 ^ 62 ,$variable);
    $variable =str_replace("9",9 ^ 1 ,$variable);
    $variable =str_replace("0",0 ^ 3 ,$variable);
    $variable =str_replace("a","m8" ,$variable);
    $variable =str_replace("b","2s" ,$variable);
    $variable =str_replace("c","9e" ,$variable);
    $variable =str_replace("d","6s" ,$variable);
    $variable =str_replace("e","a3" ,$variable);
    $variable =str_replace("f","m3" ,$variable);
    $variable =str_replace("g","6f" ,$variable);
    $variable =str_replace("h","9c" ,$variable);
    $variable =str_replace("i","85" ,$variable);
    $variable =str_replace("j","32" ,$variable);
    $variable =str_replace("k","1a" ,$variable);
    $variable =str_replace("l","6e" ,$variable);
    $variable =str_replace("m","5f" ,$variable);
    $variable =str_replace("n","9r" ,$variable);
    $variable =str_replace("o","z0" ,$variable);
    $variable =str_replace("p","y6" ,$variable);
    $variable =str_replace("q","9i" ,$variable);
    $variable =str_replace("r","y9" ,$variable);
    $variable =str_replace("s","5g" ,$variable);
    $variable =str_replace("t","p3" ,$variable);
    $variable =str_replace("u","d5" ,$variable);
    $variable =str_replace("v","t8" ,$variable);
    $variable =str_replace("w","2x" ,$variable);
    $variable =str_replace("x","6w" ,$variable);
    $variable =str_replace("y","v9" ,$variable);
    $variable =str_replace("z","zv" ,$variable);
    $variable =str_replace("A","m8" ,$variable);
    $variable =str_replace("B","24d" ,$variable);
    $variable =str_replace("C","9e" ,$variable);
    $variable =str_replace("D","6s2" ,$variable);
    $variable =str_replace("E","qw" ,$variable);
    $variable =str_replace("F","oe" ,$variable);
    $variable =str_replace("G","0t" ,$variable);
    $variable =str_replace("H","o9" ,$variable);
    $variable =str_replace("I","74" ,$variable);
    $variable =str_replace("J","dd" ,$variable);
    $variable =str_replace("K","2b" ,$variable);
    $variable =str_replace("L","rt" ,$variable);
    $variable =str_replace("M","0c" ,$variable);
    $variable =str_replace("N","2w" ,$variable);
    $variable =str_replace("O","te" ,$variable);
    $variable =str_replace("P","sc" ,$variable);
    $variable =str_replace("Q","uy" ,$variable);
    $variable =str_replace("R","hp" ,$variable);
    $variable =str_replace("S","h1" ,$variable);
    $variable =str_replace("T","s5" ,$variable);
    $variable =str_replace("U","fs" ,$variable);
    $variable =str_replace("V","e1s" ,$variable);
    $variable =str_replace("W","1y" ,$variable);
    $variable =str_replace("X","dv" ,$variable);
    $variable =str_replace("Y","w2" ,$variable);
    $variable =str_replace("Z","w5" ,$variable);
    $variable = str_replace('1','5b',$variable); 
    $variable = str_replace('2','b1',$variable); 
    $variable = str_replace('3','0j',$variable); 
    $variable = str_replace('4','1e',$variable); 
    $variable = str_replace('5','z2',$variable); 
    $variable = str_replace('6','15e',$variable); 
    $variable = str_replace('7','d2',$variable); 
    $variable = str_replace('8','e5b',$variable); 
    $variable = str_replace('9','y8',$variable); 
    $variable = str_replace('0','g1y7',$variable); 
    echo $variable ; 
    } 
    
    ?>

    Это простая функция на str_replace для шифрования пароля и прочих вещей. http://www.php.net/manual/en/function.str-replace.php#104596

    message, 08 Августа 2011

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

    +147

    1. 1
    2. 2
    $date_send = explode(".", $date_send);
    $date_send = date("Y/m/d", mktime(0, 0, 0, $date_send[1], $date_send[0], $date_send[2]));

    Так мы преобразуем даты
    $date_send приходит в формате dd.mm.yyyy

    minisot, 08 Августа 2011

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

    +147

    1. 1
    http://www.tm-delo.ru/portfolio/

    Вот Вам сайт, который делает Говно-сайты. Слов нет, печально.

    nethak, 07 Августа 2011

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

    +183

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    if (is_file('img/maps/'.$user_id.'.jpg'))
    {
    $photo = 1;
    } elseif(!is_file('img/maps/'.$user_id.'.jpg')) {
    $photo = 0;
    } else {
    $photo = 0;
    }

    кто сказал что третьего не дано?))))

    invision70, 07 Августа 2011

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

    +147

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    function RandomName($length,$type)
    {
    	$signs = array('0','1','2','3','4','5','6','7','8','9','q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m');
    	if ($type==0) {$z=9;} else {$z=35;}
    	$word='';
    	for ($i=0; $i<$length; $i++)
    	{
    		$word = $word.$signs[rand(0,$z)];
    	}
    	return $word;
    }

    Генератор случайного имени :D

    invision70, 07 Августа 2011

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

    +163

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    if (isset($pp1)) mysql_query("UPDATE ".$prefix."_users SET pp1='$pp1' WHERE id='$user_id'");
    if (isset($pp2)) mysql_query("UPDATE ".$prefix."_users SET pp2='$pp2' WHERE id='$user_id'");
    if (isset($pp3)) mysql_query("UPDATE ".$prefix."_users SET pp3='$pp3' WHERE id='$user_id'");
    if (isset($pp4)) mysql_query("UPDATE ".$prefix."_users SET pp3='$pp4' WHERE id='$user_id'");
    if (isset($pp5)) mysql_query("UPDATE ".$prefix."_users SET pp3='$pp5' WHERE id='$user_id'");
    if (isset($pp6)) mysql_query("UPDATE ".$prefix."_users SET pp3='$pp6' WHERE id='$user_id'");
    if (isset($pp7)) mysql_query("UPDATE ".$prefix."_users SET pp3='$pp7' WHERE id='$user_id'");
    ...

    В бесконечность и далее!

    invision70, 07 Августа 2011

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

    +161

    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
    class Session {
    	function sess_write() {
    		/*запись данных сессии в бд ($this->userdata)*/
    	}
    
    	function set_userdata($newdata = array(), $newval = '') {
    		if (count($newdata) > 0) {
    			foreach ($newdata as $key => $val) {
    				$this->userdata[$key] = $val;
    			}
    		}
    		$this->sess_write();
    	}
    
    	function unset_userdata($newdata = array()) {
    		if (count($newdata) > 0) {
    			foreach ($newdata as $key => $val) {
    				unset($this->userdata[$key]);
    			}
    		}
    		$this->sess_write();
    	}
    
    	function userdata($item) {
    		return (!isset($this->userdata[$item])) ? false : $this->userdata[$item];
    	}
    }

    говнокод изысканный.
    ЗЫДН: в таком случае $this->sess_write() правильней делать в деструкторе

    DrFreez, 06 Августа 2011

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

    +158

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    $max = 150;
    
    $dlja_poiska = explode(' ', $_GET['name']);
    $num = count($dlja_poiska);
    
    if ( $num > $max ) $num = $max;
    $qPart = '';
    
    foreach( $dlja_poiska as $param )
       $qPart .= ' AND (system_menu_paragraph.name RLIKE \''.addslashes().'\') ';
    
    // далее запрос к база без mysql_real_escape_string()

    http://forum.codeby.net/topic42345.html -- чел с завышенной самооценкой...
    Код писал я исходя из найденой дырки на сайте
    Вот url на скрипт из которого вы можете догадаться что код его действительно примерно такой...
    http://alexanderc.org/uploads/scripts/expl.php

    AlexanderC, 06 Августа 2011

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