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

    +9

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    /*======================================================================*\
    	Function:	__destruct
    	Output:		Нет
    	Descriiption: Уничтожение объекта
    	\*======================================================================*/
    	public function __destruct(){
    	
    	}

    Javadoc отдыхает.

    sevenflash, 19 Февраля 2016

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

    +2

    1. 1
    $sqo_answer['remark']!=''?$sqo_answer['remark']:''

    найдено на реальном проекте. один из тысячи

    castortroy06, 17 Февраля 2016

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

    −1

    1. 1
    $filds[$fild['fild']] = array('fild' => $fild['fild'],'name' => $fild['name'],'options'=>explode(',',$fild['type']));

    Филд Коллиндз

    deep, 15 Февраля 2016

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

    +5

    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
    FUNCTION PHP_FIREWALL_get_env($st_var) {
    		global $HTTP_SERVER_VARS;
    		if(isset($_SERVER[$st_var])) {
    			return strip_tags( $_SERVER[$st_var] );
    		} elseif(isset($_ENV[$st_var])) {
    			return strip_tags( $_ENV[$st_var] );
    		} elseif(isset($HTTP_SERVER_VARS[$st_var])) {
    			return strip_tags( $HTTP_SERVER_VARS[$st_var] );
    		} elseif(getenv($st_var)) {
    			return strip_tags( getenv($st_var) );
    		} elseif(function_exists('apache_getenv') && apache_getenv($st_var, true)) {
    			return strip_tags( apache_getenv($st_var, true) );
    		}
    		return '';
    	}

    Это шедевр!

    d_fomenok, 14 Февраля 2016

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

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    $host = Doctrine_Core::getTable("TransfertConfij")->find(1)->emailserver;
    $emailto = $form->getValue('addresstestemail');
    $port = Doctrine_Core::getTable("TransfertConfij")->find(1)->port;
    $encriptyon = Doctrine_Core::getTable("TransfertConfij")->find(1)->encriptyon;
    $login = Doctrine_Core::getTable("TransfertConfij")->find(1)->loginemailserver;
    $pass = Doctrine_Core::getTable("TransfertConfij")->find(1)->passemailserver;
    $content = $form->getValue('contenttestemail');
    
    // Далее код отправки письма.

    5 запросов? Какая разница? работает ведь!

    rkgrep, 14 Февраля 2016

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

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    <?php
    global $userinfo;
    ...
    $a_query = "select id,name,company,email,phone,url,type from user where login='" .
    								$_SESSION["se_login"] . "' and passwd='" .
    								$_SESSION["se_passwd"] . "' and status=1";
    $a_res = mysql_query($a_query);
    ...
    list($userinfo['id'],$userinfo['name'],$userinfo['company'],$userinfo['email'],$userinfo['phone'],$userinfo['url'],$userinfo['type']) = mysql_fetch_row($a_res);
    ...

    roman_gemini, 13 Февраля 2016

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

    −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
    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
    <?php
    	global $userinfo;
    	global $smarty;
    	global $cl;
    	$userinfo['id'] = 0;
    	$userinfo['name'] = '';
    	$userinfo['email'] = '';
    	$userinfo['phone'] = '';
    	$userinfo['url'] = '';
    	$userinfo['company'] = '';
    	$userinfo['type'] = '';
    
    	$flogin = def_var('flogin','');
    	$fpasswd = def_var('fpasswd','');
    	$fremember = def_var('fremember',0);
    	if ($fpasswd) {
    		$fpasswd = md5($fpasswd);
    		$_SESSION["se_login"] = $flogin;
    		$_SESSION["se_passwd"] = $fpasswd;
    	} elseif (isset($_COOKIE["co_login"]) && isset($_COOKIE["co_passwd"])) {
    		$_SESSION["se_login"] = $_COOKIE['co_login'];
    		$_SESSION["se_passwd"] = $_COOKIE['co_passwd'];
    	}
    	$auth_msg = '';
    	if (isset($_SESSION["se_login"]) && isset($_SESSION["se_passwd"])) {
    		$a_query = "select id,name,company,email,phone,url,type from user where login='" .
    								$_SESSION["se_login"] . "' and passwd='" .
    								$_SESSION["se_passwd"] . "' and status=1";
    		$a_res = mysql_query($a_query);
    		if (mysql_num_rows($a_res) > 0) {
    			$ip_res = mysql_query("select ip from ipban where ip='".$_SERVER['REMOTE_ADDR']."'");
    			if (!mysql_num_rows($ip_res)) {
    				if ($fremember == 1) {
    					setcookie("co_login",$_SESSION["se_login"],time()+60*60*24*10000,"/", $_SERVER['SERVER_NAME']);
    					setcookie("co_passwd",$_SESSION["se_passwd"],time()+60*60*24*10000,"/", $_SERVER['SERVER_NAME']);
    				}
    				list($userinfo['id'],$userinfo['name'],$userinfo['company'],$userinfo['email'],$userinfo['phone'],
    					$userinfo['url'],$userinfo['type']) =
    					mysql_fetch_row($a_res);
    				mysql_query("update user set last_ip = '".$_SERVER['REMOTE_ADDR']."' where id=".$userinfo['id']);
    			} else {
    				$auth_msg = $cl['authorization_error'];
    			}
    		} else {
    			unset($_SESSION["se_login"]);
    			unset($_SESSION["se_passwd"]);
    			$auth_msg = $cl['authorization_error'];
    		}
    	}
    	if (isset($smarty)) {
    		$smarty->assign('auth_msg',$auth_msg);	
    	}
    ?>

    Типо авторизация

    roman_gemini, 12 Февраля 2016

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

    +10

    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
    class infoshow
    {
    
    
        public function success($text)
        {
    
    
            return "<div class=\"alert alert-success\">" . $text . "</div>";
        }
    
    
        public function info($text)
        {
    
    
            return "<div class=\"alert alert-info\">" . $text . "</div>";
        }
    
    
        public function warning($text)
        {
    
    
            return "<div class=\"alert alert-warning\">" . $text . "</div>";
        }
    
    
        public function danger($text)
        {
    
    
            return "<div class=\"alert alert-danger\">" . $text . "</div>";
        }
    
    }

    Учим ООП

    CoolCoder, 12 Февраля 2016

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

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    if(file_exists("uploads/".$row['id'].".png")){
        $urlimg="cursor: pointer;background-image: url('/uploads/".$row['id'].".png');background-size: 250px;";
    }else{
        $urlimg="cursor: pointer;background-image: url('newimg/?{$row['url']}');";
    
    }
                $write .= ' 
                                <div class="thumb" style="'.$urlimg.'" onclick="location.href=\'/page/'.$row['id'].'/\'"></div>
                                ';

    CoolCoder, 12 Февраля 2016

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    $row['sub']=str_replace("{&amp;quot;",'{"',$row['sub']);
        $row['sub']=str_replace("&amp;quot;:&amp;quot;",'":"',$row['sub']);
        $row['sub']=str_replace("&quot;",'"',$row['sub']);
        $row['sub']=str_replace("&amp;",'"',$row['sub']);
        $row['sub']=str_replace("quot;:quot;",'":"',$row['sub']);
        $row['sub']=str_replace("{quot;",'{"',$row['sub']);
        $row['sub']=str_replace("quot;}",'"}',$row['sub']);
        $row['sub']=str_replace("quot;:",'":',$row['sub']);
        $sub = json_decode($row['sub']);

    CoolCoder, 12 Февраля 2016

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