- 1
- 2
- 3
- 4
- 5
- 6
- 7
<?php
ololo();
exit; die(); break; continue;
function ololo() {
echo 'Оказываеца работает';
}
?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+139
<?php
ololo();
exit; die(); break; continue;
function ololo() {
echo 'Оказываеца работает';
}
?>
Мистика
+151
private function GetUnitType($unitType)
{
if($unitType)
if(!UnitType::Exist($unitType))
{
Debug::error("WebPartCommentsList:: UnitType не найден");
exit;
}
else
$this->UnitType = UnitType::GetUnitTypeId($this->UnitType);
}
проверка на существование сущности внутри класса, причём реально $unitType == $this->UnitType
писал ...
+148
if ($_POST['name']!='') {
$name=post_check($_POST['name'],10);
}else {
unset($_POST);
$_SESSION['error']='Не введено имя';
header("location: index.php?mode=registration");
exit;
}
Проверка данных
+149.7
function iz_cifr($a)
{
return ((strlen(addcslashes($a, '0123456789')) == 2 * strlen($a)) && ($a != ''));
}
Индусская проверка на то, состоит ли строка только из цифр
+146
<?php $this->html('headscripts') ?>
<?php if($this->data['jsvarurl' ]) { ?>
<script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"><!-- site js --></script>
<?php } ?>
<?php if($this->data['pagecss' ]) { ?>
<style type="text/css"><?php $this->html('pagecss' ) ?></style>
<?php }
if($this->data['usercss' ]) { ?>
<style type="text/css"><?php $this->html('usercss' ) ?></style>
<?php }
if($this->data['userjs' ]) { ?>
<script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
<?php }
if($this->data['userjsprev']) { ?>
<script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
<?php }
if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
</head>
<body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
<?php if($this->data['body_onload' ]) { ?> onload="<?php $this->text('body_onload') ?>"<?php } ?>
class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>
Разработчики википедии обожают php-теги
+151
foreach ($polzavateli as $polzavatel){
$i++;
echo $polzavatel[$i];
}
профессиональный обход массива :)
+152
echo "<FORM NAME=\"row\" ACTION=\"pdp_car_mis_valid.php\" METHOD=\"POST\" TARGET=\"_top\" ";?>onsubmit="blocker.style.display='block';blockfield.focus();return true;">
Однажды встретил такое в серьезном проекте. Причем вроде опытный человек писал...
+148
if($_SESSION['login'])
{
/*$topics=mysql_query("SELECT * FROM shviewstopic") or die ("Ошибка: Не могу выбрать таблицу для просмотра тем");
while($topic=mysql_fetch_array($topics))
{
echo "Пусто";
} */
$timestamp=time();
$ip = getenv("REMOTE_ADDR");
mysql_query("UPDATE shsession SET user='".$_SESSION['login']."', timestamp='".$timestamp."', id='".$_SESSION['id']."' WHERE ip='".$ip."'") or die (mysql_error());
}
сам не знаю, чего пытался сделать:)
+160.5
//...
$br="
";
//...
+149
if (CForm::is_submit($this->class_name.'_list', 'delete') ) {
$this->cmd_delete();
}elseif (CForm::is_submit($this->class_name.'_form', 'delete') ) {
$this->cmd_delete();
}elseif (!CForm::is_submit($this->class_name.'_form') && InGetPost('cmd', '') == 'delete') {
if (is_numeric(InGet('wi2c_id')))
$this->delete_wi2c(InGet('wi2c_id'));
elseif (is_numeric(InGet('s2c_id')))
$this->delete_s2c(InGet('s2c_id'));
elseif (is_numeric(InGet('w2c_id')))
$this->delete_w2c(InGet('w2c_id'));
elseif (is_numeric(InGet('spl_id')))
$this->delete_spl(InGet('spl_id'));
elseif (is_numeric(InGet($this->table_key_5)))
$this->delete_p2wi(InGet($this->table_key_5));
elseif (is_numeric(InGet('color_id')))
$this->delete_color(InGet('color_id'));
elseif (is_numeric(InGet('edit_id')))
$this->cmd_delete();
}elseif (CForm::is_submit($this->class_name.'_form', 'addSize') ) {
$this->cmd_add_sizes();
}elseif (CForm::is_submit($this->class_name.'_form', 'addSize2') ) {
$this->cmd_add_sizes2();
}elseif (CForm::is_submit($this->class_name.'_form', 'addSize3') ) {
$this->cmd_add_sizes3();
}elseif (CForm::is_submit($this->class_name.'_form', 'addSize4') ) {
$this->cmd_add_sizes4();
}elseif (CForm::is_submit($this->class_name.'_form', 'addSize5') ) {
$this->cmd_add_sizes5();
}elseif (CForm::is_submit($this->class_name.'_form', 'addSplash') ) {
$this->cmd_add_splash();
}elseif (CForm::is_submit($this->class_name.'_list', 'insert') ) {
$this->cmd_new();
}elseif (CForm::is_submit($this->class_name.'_list', 'edit') || InGetPost('cmd', '') == 'edit' ) {
//$this->cmd_edit();
}elseif (CForm::is_submit($this->class_name.'_form', 'form_action') ) {
if ( $this->obj_id == 0 )
$this->cmd_add();
else
$this->cmd_update();
}else{
//$this->cmd_list();
}
//echo $iCategoryID;
Рядом с вот этим http://govnokod.ru/1151, лежала еще одна куча. Вот решил наговнять. Автор не я.