1. Лучший говнокод

    В номинации:
    За время:
  2. JavaScript / Говнокод #1366

    +176.5

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    function Fields_Change()
    {
       if (username.value == "")
       {
          username.value = lbUserName.innerHTML;
       }
       if (username.value == lbUserName.innerHTML)
       {
          username.value = "";
       }
    }

    guest, 12 Июля 2009

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

    +176.4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    if($n==1 or $n==3 or $n==3 or $n==4 or $n==5) {
    if($n ==1 ) {$result = mysql_query("SELECT * FROM spec WHERE id_fac='$id_fac' and 1c='1' and id_sett='1'");}
    if($n ==2 ) {$result = mysql_query("SELECT * FROM spec WHERE id_fac='$id_fac' and 2c='1' and id_sett='1'");}
    if($n ==3 ) {$result = mysql_query("SELECT * FROM spec WHERE id_fac='$id_fac' and 3c='1' and id_sett='1'");}
    if($n ==4 ) {$result = mysql_query("SELECT * FROM spec WHERE id_fac='$id_fac' and 4c='1' and id_sett='1'");}
    if($n ==5 ) {$result = mysql_query("SELECT * FROM spec WHERE id_fac='$id_fac' and 5c='1' and id_sett='1'");}}

    кусок из примера кода, который чувак прислал к нам в контору вместе с резюме

    nolka4, 21 Августа 2009

    Комментарии (24)
  4. JavaScript / Говнокод #468

    +176.4

    1. 1
    2. 2
    3. 3
    4. 4
    if ('yes'!= 'yes') {
    	checkCaptcha();
    	return true;
    }

    в кодах блог движка нашел подобное..

    guest, 27 Января 2009

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

    +176.1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $little=array('а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п','р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
    $big=   array('А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
    	while($d1 = mysql_fetch_array($d)){
    		$name2 = str_replace($little, $big, $d1["name"]);
            }

    вместо ф-ции strtoupper()

    guest, 15 Марта 2009

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

    +176

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function convert_date($date) {
        $part_date = explode(" ", $date);
        $part_day = explode("-", $part_date[0]);
        $year = $part_day[0];
        $month = $part_day[1];
        $day = $part_day[2];
        $part_time = explode(":", $part_date[1]);
        $hour = $part_time[0];
        $min = $part_time[1];
        $result = $day . "." . $month . "." . $year;
        return $result;
    }

    Трудное решение легких проблем

    eugene111222, 27 Февраля 2014

    Комментарии (11)
  7. JavaScript / Говнокод #10293

    +176

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function getAnchor(link){
    	var url=( (!link) ? window.location : link).toString();
    	var idx = url.indexOf("#");
    	return (idx != -1 ? url.substring(idx+1) : '');	
    }
    function setAnchor(anchor){
    	var url=(window.location).toString();
    	var idx = url.indexOf("#");
    	return ( window.location= 
    		(idx != -1 ? url.substring(0,idx+1) : url+'#')+anchor
    	);
    }

    3.14159265, 16 Мая 2012

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

    +176

    1. 1
    2. 2
    3. 3
    public function setPIDorSEORedirect($id, $disableVarName = '') {
            ........
    }

    отличное название метода)))

    aleksssmix, 17 Февраля 2012

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

    +176

    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
    $query = "
    			SELECT `ord`.*,`cus`.`existing_phone_number`,`cus`.`nova_jednotka`,
    				`cus`.`order_phone`,`cus`.`custom_delivery_date`, `cus`.`delivery_address`,
    				`cus`.`invoice_address`, `cus`.`invoice_street`, `cus`.`invoice_street_number`,
    				`cus`.`invoice_city`, `cus`.`invoice_zip`
    			FROM ".(!empty($_GET["copy_view"]) && $_GET["copy_view"] == 1 ? "`orders`" : "`".$this->table."`")." AS `ord`,
    				`products`, `navigace`, `customers` AS `cus`
    			WHERE `ord`.`order_id` = ".$order_id."
    				AND `ord`.`id_produktu_db` = `products`.`id`
    				AND `products`.`navigace_polozka_id` = `navigace`.`id`
    				AND `cus`.`id` = `ord`.`customers_id`
    			union all
    			select
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, 
                                    '', tp.description, tp.product_id, tp.activation_price, tp.activation_price_EUR,
    				0, tor.pocet_kusu, tp.name, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null, 
                                    null, null, null, null, null, null, null, null, null, null, null, null, null
    			from tarifs_prop tp
    			inner join tarifs_orders tor on tp.id = tor.tarif_prop_id
    			where tor.order_id = ".$order_id."
    			union all
    			select
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, '', b.description, b.product_id, b.activation_price, b.activation_price_EUR,
    				0, tor.pocet_kusu, b.name, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null, 
                                    null, null, null, null, null, null, null, 
                                    null, null, null, null, null, null
    			from balicky b
    			inner join tarifs_orders tor on b.id = tor.tarif_balicek_id
    			where tor.order_id = ".$order_id."
    			ORDER BY `user_id` desc";

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

    Lameaux, 29 Ноября 2011

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

    +176

    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
    if (strpos($_SERVER[HTTP_REFERER], "chocobo.us")) {
    	echo("Go away kids.");
    	exit;
    }
    
    
    if (strpos($_SERVER[REMOTE_HOST], "midmich.net")) { echo("Dry your eyes son, not everyone can be funny."); }
    if (strpos($_SERVER[REMOTE_HOST], "rima-tde.net")) { echo("spam == permban"); }
    #if ($REMOTE_ADDR == "12.227.136.202") {echo("Cheap sluts need not apply.");exit;}
    if ($REMOTE_ADDR == "129.252.177.248") {die(0);}
    if ($REMOTE_ADDR == "80.190.209.170") {die(0); }
    if ($REMOTE_ADDR == "62.163.74.167") {die(0);}
    if ($REMOTE_ADDR == "69.10.120.117") {echo("bye bye");exit;}
    if ($REMOTE_ADDR == "24.10.146.28") {echo("flooding the queue with nonsense == ban");exit;}
    if ($REMOTE_ADDR == "80.202.184.96") {echo("there is but one qdb.  ripoff artists need not apply.");exit;}
    if ($REMOTE_ADDR == "216.24.104.36") {echo("Blaxthos: yeah so, however many quotes us bash mods reject is how many cocks we suck -- take it easy");exit;}
    if ($REMOTE_ADDR == "217.230.240.250") die("No.");
    if ($REMOTE_ADDR == "134.102.2.100") {exit;}
    if ($REMOTE_ADDR == "217.64.202.205") {echo("you == idiot");exit;}
    if ($REMOTE_ADDR == "64.237.52.210") {exit;}
    if ($REMOTE_ADDR == "155.143.208.237") {exit;}
    if ($REMOTE_ADDR == "82.165.144.86") {exit;}
    if ($REMOTE_ADDR == "141.157.35.222") {echo("Go away.");exit;}
    if ($REMOTE_ADDR == "80.198.19.122") {echo("Fuck off.");exit;}
    if ($REMOTE_ADDR == "192.93.2.12") {echo("Fuck off.");exit;}
    if ($REMOTE_ADDR == "24.235.181.61") {echo("*fuckx* bash.org is for niggers.");exit;}
    if ($REMOTE_ADDR == "213.202.130.44") {echo("Fuck off.");exit;}
    if ($REMOTE_ADDR == "130.194.13.106") {echo("Fuck off.");exit;}
    if ($REMOTE_ADDR == "144.132.68.119") {echo("Fuck off.");exit;}
    if ($REMOTE_ADDR == "81.1.73.247") {echo("your access has been revoked");exit;}
    if ($REMOTE_ADDR == "68.13.143.147") {exit;}
    if ($REMOTE_ADDR == "217.8.141.230") {exit;}
    if ($REMOTE_ADDR == "62.101.198.25") {exit;}
    if ($REMOTE_ADDR == "80.96.109.170") {exit;}
    if ($REMOTE_ADDR == "80.60.182.139") {exit;}
    if ($REMOTE_ADDR == "4.21.108.175") {echo("Flooding the submission queue.  (Banned)");exit;}
    if ($REMOTE_ADDR == "151.188.16.17") {echo("Thanks for your letter.  --Blaxthos (you can all thank Lunch Box Prime (some fuckchop on AIM)");exit;}
    if ($REMOTE_ADDR == "203.217.65.231") {echo("No more.");exit;}
    if ($REMOTE_ADDR == "68.111.156.240") {echo("No more.");exit;}
    if ($REMOTE_ADDR == "82.149.227.249") {echo("No more.");exit;}

    http://webcache.googleusercontent.com/search?q=cache%3Abash.org%2Findex.bak

    Crazy_penguin, 24 Октября 2011

    Комментарии (19)
  11. PHP / Говнокод #8100

    +176

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    <?php
    
    $login = 'XXXXX';
    $pass  = 'XXXXXXXX';
    
    if (@$_COOKIE['login'] != $login) {
        setcookie('login',$login,time()+60*60*24,'/');
    }
    if (@$_COOKIE['password'] != $pass) {
        setcookie('password',$pass,time()+60*60*24,'/');
    }

    Вот такая интересная проверка на авторизацию.

    airrussia, 06 Октября 2011

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