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

    +165

    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
    <?php
    #-----------------------------------------------------#
    #          ********* ROTORCMS *********               #
    #              Made by  :  VANTUZ                     #
    #               E-mail  :  [email protected]         #
    #                 Site  :  http://pizdec.ru           #
    #             WAP-Site  :  http://visavi.net          #
    #                  ICQ  :  36-44-66                   #
    #  Вы не имеете право вносить изменения в код скрипта #
    #        для его дальнейшего распространения          #
    #-----------------------------------------------------#	
    require_once ('includes/start.php');
    require_once ('includes/functions.php');
    require_once ('includes/header.php');
    include_once ('themes/' . $config['themes'] . '/index.php');
    
    if (empty($_GET['p'])) {
        include_once (BASEDIR . 'includes/info.php');
        include_once (DATADIR . 'main/index_head.dat');
        include_once (DATADIR . 'main/begin.dat');
        include_once (DATADIR . 'main/index.dat');
        include_once (DATADIR . 'main/index_foot.dat');
    } else {
        if (empty($_GET['f'])) {
            $_GET['f'] = 'index';
        } 
        if (preg_match('|^[a-z0-9_\-]+$|i', $_GET['p']) && preg_match('|^[a-z0-9_\-]+$|i', $_GET['f'])) {
            if (file_exists('files/' . $_GET['p'] . '/' . $_GET['f'] . '.' . $config['ras'])) {
                include_once ('files/' . $_GET['p'] . '/' . $_GET['f'] . '.' . $config['ras']);
            } else {
                show_error('Ошибка! Файл с данными параметрами не найден!');
            } 
        } else {
            show_error('Ошибка! Недопустимое название страницы!');
        } 
    
        echo '<img src="' . BASEDIR . 'images/img/act_home.gif" alt="image" /> <a href="' . BASEDIR . 'index.php?' . SID . '">На главную</a>';
    } 
    
    include_once ('themes/' . $config['themes'] . '/foot.php');
    
    ?>

    Представляем вашему вниманию первую версию движка RotorCMS!!!

    p.s. Угадайте где здесь говнокод?)

    lads, 11 Августа 2010

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

    +167

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $url=$_SERVER['QUERY_STRING'];
    parse_str($url, $out);
    @$tbname=$out['tbname'];
    @$pname=$out['pname'];
    @$sub=$out['sub'];

    http://forum.php.su/topic.php?forum=60&topic=1371#1281343178

    А как ВЫ принимаете параметры запроса?

    Uchkuma, 10 Августа 2010

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

    +171

    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
    include('conf.php');
    
    $domen=strip_tags($_POST['domain']);
    $descr=strip_tags($_POST['descr']);
    $admin=strip_tags($_POST['admin']);
    $tech=strip_tags($_POST['tech']);
    $nserver1=strip_tags($_POST['nserver1']);
    $nserver2=strip_tags($_POST['nserver2']);
    $mail=strip_tags($_POST['changed']);
    $submit=strip_tags($_POST['s']);
    
    if($_POST['s']){
    $simbol='|[^a-z0-9-]|i'; if(!preg_match($simbol, $domen)) {
    if($domen){ 
    if($descr){ 
    if($admin){
    if($tech){
    if($nserver1){
    if($nserver2){
    if($mail){if (preg_match("|[0-9a-z^_]+@[0-9a-z_^.]+.[a-z]{2,3}|i",$mail)){
    
    $headers = "Content-Type: text/plain; charset=windows-1251\n";
    $headers .= "From: ".$_POST['changed']."\n";
    $headers .= "X-Priority: 3\r\n";
    
    $tem="ADD $domen.org.ua";
    
    $msg ="domain: $domen.org.ua
    descr: $descr
    admin-c: $admin
    tech-c:  $tech
    nserver: $nserver1
    nserver: $nserver2
    changed: $mail ".date("Ymd")."
    source: UANIC";
    
    mail("[email protected]", "$tem", $msg, $headers);
    
    echo "Заявка отправлена со следующими данными:<br><br>";
    echo"Название домена: <strong><font color=\"#ff0000\">$domen.org.ua</font></strong><br>";
    echo"Описание домена: <strong><font color=\"#ff0000\">$descr</font></strong><br>";
    echo"Администратор домена: <strong><font color=\"#ff0000\">$admin</font></strong><br>";
    echo"Технический контакт домена: <strong><font color=\"#ff0000\">$tech</font></strong><br>";
    echo"DNS Сервер № 1: <strong><font color=\"#ff0000\">$nserver1</font></strong><br>";
    echo"DNS Сервер № 1:  <strong><font color=\"#ff0000\">$nserver2</font></strong><br>";
    echo"Ваш E-mail: <strong><font color=\"#ff0000\">$mail</font>   ".date("Ymd")."</strong><br><br>";
    echo"В течении 10 минут проверьте ваш почтовый ящчик <strong><font color=\"#00ff00\">$mail</font></strong> на наличие ссылки о подтверждении регистрации доменного имени";
    exit(); 
    
    }else{echo "<center>$error9<br>"; include('index.html');  die;}
    }else{echo "<center>$error8<br>"; include('index.html');  die;}
    }else{echo "<center>$error7<br>"; include('index.html');  die;}
    }else{echo "<center>$error6<br>"; include('index.html');  die;}
    }else{echo "<center>$error5<br>"; include('index.html');  die;}
    }else{echo "<center>$error4<br>"; include('index.html');  die;}
    }else{echo "<center>$error3<br>"; include('index.html');  die;}
    }else{echo "<center>$error2<br>"; include('index.html');  die;}
    }else{echo "<center>$error10<br>"; include('index.html');  die;}
    }else{echo "<center>$error1<br>"; include('index.html');  die;}

    ящчик :D

    GoodTalkBot, 10 Августа 2010

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

    +168

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    function Logika($f)
    {
            $t=($f=true) ? true : false
            switch($t)
            {
                  case true:  $return=1; break;
                  case false: $return=0; break;
                  default: $return;break;
            }
            return $return;
    }

    Да-да-да, про тернарный было много раз, просто это особенно впечатлило.

    scalar4eblo4no, 09 Августа 2010

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

    +160

    1. 1
    <input title="<?=$this->tooltip?>" <?=($this->max_length != "maxlength='$this->max_length'" ? "" : "")?> type="text"

    tiger_seo, 09 Августа 2010

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

    +153

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    // credits. To remove, see configuration file
    $img2 = imagecreatetruecolor($width, $height + ($show_credits ? 12 : 0));
    $foreground = imagecolorallocate($img2, $foreground_color[0], $foreground_color[1], $foreground_color[2]);
    $background = imagecolorallocate($img2, $background_color[0], $background_color[1], $background_color[2]);
    imagefilledrectangle($img2, 0, 0, $width - 1, $height - 1, $background);
    imagefilledrectangle($img2, 0, $height, $width - 1, $height + 12, $foreground);
    $credits = empty($credits) ? $_SERVER['HTTP_HOST'] : $credits;
    imagestring($img2, 2, $width / 2 - imagefontwidth(2) * strlen($credits) / 2, $height - 2, $credits, $background);

    Чтобы не показывать credits надо нарисовать их за границей изображения.
    http://www.captcha.ru/kcaptcha/

    sectus, 09 Августа 2010

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

    +151

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    echo '<form method="" name="aut" action="a.php?"> 
    <input type = "submit" name = "knopka" value = "OK"></form>'; 
    
    for ($i = 1; $i count($knopka); $i++) { 
    if (isset($_REQUEST[knopka])) { 
    echo 'Кнопка была нажата '.$i.' раз'; 
    } else { 
    echo 'Кнопка не была нажата'; 
    }

    это даже не смешно http://forum.wen.ru/?p=3&f=6&t=367051&w=htm снова перлы веника

    GoodTalkBot, 08 Августа 2010

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

    +164

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    <?php
    $page=$_GET['p'];
    
    if(abs(intval($page)).""==$page) {
    // ...
    }
    ?>

    Нашел в своём старом коде. Ну да, я тоже когда-то не знал, про is_int();

    mr.The, 08 Августа 2010

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

    +167

    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
    if ($avtoritet >= 0 and $avtoritet < 5) { 
    $avtr = 'Зеленый'; 
    } 
    elseif ($avtoritet >= 5 and $avtoritet < 10) { 
    $avtr = 'Чайник'; 
    } 
    elseif ($avtoritet >= 10 and $avtoritet < 15) { 
    $avrt = 'Наш чел'; 
    } 
    elseif ($avtoritet >= 15 and $avtoritet < 20) { 
    $avtr = 'Уважаемый'; 
    } 
    elseif ($avtoritet >= 20 and $avtoritet < 30) { 
    $avtr = 'Почётный'; 
    } 
    elseif ($avtoritet >= 30 and $avtoritet < 50) { 
    $avtr = 'Вышибало'; 
    } 
    elseif ($avtoritet >= 50) { 
    $avtr = 'Независимый'; 
    } 
    else 
    { 
    if ($avtoritet1 >= 1 and $avtoritet1 < 5) { 
    $avtr = 'Салага'; 
    } 
    elseif ($avtoritet1 >= 5 and $avtoritet1 < 10) { 
    $avtr = 'Барыжко'; 
    } 
    elseif ($avtoritet1 >= 10 and $avtoritet1 < 15) { 
    $avtr = 'Кидалко'; 
    } 
    elseif ($avtoritet1 >= 15 and $avtoritet1 < 25) { 
    $avtr = 'Мего_кидало'; 
    } 
    }

    http://forum.wen.ru/?p=3&f=6&t=366964&w=htm

    GoodTalkBot, 08 Августа 2010

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

    +151

    1. 1
    $o = ($o < 0) ? 0 : $o;

    Оооо, как меня задолбал такой код

    sogekoder, 08 Августа 2010

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