- 1
- 2
- 3
- 4
<?php
session_start();
$_SESSION['gde']='tut';
?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+143
<?php
session_start();
$_SESSION['gde']='tut';
?>
Где? Тут.
+46.7
$t = new Table('foo');
$t->th('Header 1');
$t->th('Header 2');
$t->th('Header 3');
$t->endRow();
for($i = 0; $i<10; $i++) {
$t->td('Cell 1');
$t->td('Cell <2>', '', true);
$t->td('Cell 3');
$t->endRow();
}
$t->end();
На выходе получаем html таблицы...
Вот так крутые пацаны понимают термин OOP,
http://habrahabr.ru/sandbox/3112/ человек хочет за изобретение инвайт, ссылка по видимому умрет, так что инвайт дарите быстрее, если шедевр вас тронул :)
+143.5
if (isset($_COOKIE['wrboardname'])) {
$wrboardname=$_COOKIE['wrboardname'];
}
// если в куках есть wrboardname, то забиваем данные куков в переменные, иначе выводим форму для входа
if (isset($wrboardname)) {
print "<td align=right style='FONT-SIZE: 11px' width=100%><a href='tools.php?event=profile&pname=$wrboardname'>Ваш Профиль</a> <a href='tools.php?event=clearcooke'>Выход [$wrboardname]</a>";
}
Показан прекрасный метод, как нужно юзать куки))(wr-board 1.1)
+153
$r3['price'] = $r3['price']*1;
вывод цены
+62.8
$date = '';
$date .= date('d');
$date .= '-'
$date .= date('m');
$date .= '-';
$date .= date('Y');
з.ы.
чтот у вас в FF форма для кода криво отображается...
+151
<?php
$data = file_get_contents('./testt.php');
$repl = array();
//<a href=""><img src="" ></a>
preg_match_all('/[^(?:\<\?.*)]*?[^(?:\<a.*href=.*\>)](?:\<img\s.*)(?:\>)[^(?:\<\/a\>)]*?[^(?:\?\>)]/Umi', $data, $repl);
echo '<pre>';
var_dump($repl);
echo '</pre>';
?>
<html>
<head>
</head>
<body>
<a href="asd">12313</a>
<img src="sadasdasd" alt="dasddasd" /><a href="asd"><img src="sadasdasd" alt="dasddasd" /></a><img src="sadasdasd" alt="dasddasd" /><img src="sadasdasd" alt="dasddasd" />
<img src="sadasdasd" alt="dasddasd" /> <img src="sadasdasd" alt="dasddasd"><br />
<img src="sadasdasd" alt="dasddasd" ><br>
<a href="asd"><img src="sadasdasd" alt="dasddasd"></a><a href="asd"><img src="sadasdasd" alt="dasddasd" ></a><a href="asd">12313</a>
<a href="asd">12313</a>
</body>
</html>
+60.3
function fromunicode($string,$lang){
if ($lang=="fr"):
return utf8_decode($string);
elseif($lang=="rus"):
$tempchar1=chr(208);
$string=ereg_replace( "Рђ" , "А" , $string);
$tempchar2=chr(145);
$tempchar=$tempchar1.$tempchar2;
$string=ereg_replace( $tempchar , "Б" , $string);
$tempchar2=chr( 146);
$tempchar=$tempchar1.$tempchar2;
$string=ereg_replace( $tempchar, "В" , $string);
$tempchar2=chr( 147);
$tempchar=$tempchar1.$tempchar2;
$string=ereg_replace( $tempchar ,"Г" , $string);
$tempchar2=chr( 148);
$tempchar=$tempchar1.$tempchar2;
$string=ereg_replace( $tempchar, "Д" , $string);
$string=ereg_replace( "Р•" , "Е" , $string);
$string=ereg_replace( "РЃ" ,"Ё" , $string);
$string=ereg_replace( "Р–" , "Ж" , $string);
$string=ereg_replace( "Р—" , "З" , $string);
$string=ereg_replace( "Р?" , "И" , $string);
$string=ereg_replace( "Р™" , "Й" , $string);
$string=ereg_replace( "Рљ" , "К" , $string);
$string=ereg_replace( "Р›" , "Л" , $string);
$string=ereg_replace( "Рњ" , "М" , $string);
$string=ereg_replace( "Рќ" , "Н" , $string);
$string=ereg_replace( "Рћ" , "О" , $string);
$string=ereg_replace( "Рџ" , "П" , $string);
//$string=ereg_replace( "Р" , "Р " , $string);
//$string=ereg_replace( "С" , "РЎ" , $string);
$string=ereg_replace( "Рў" , "Т" , $string);
$string=ereg_replace( "РЈ" , "У" , $string);
$string=ereg_replace( "Р¤" , "Ф" , $string);
$string=ereg_replace("РҐ" , "Х" , $string);
$string=ereg_replace( "Р¦" , "Ц" , $string);
$string=ereg_replace( "Р§" , "Ч" , $string);
$string=ereg_replace( "РЁ" , "Ш" , $string);
$string=ereg_replace( "Р©" , "Щ" , $string);
$string=ereg_replace( "Р¬" , "Ь" , $string);
$tempchar2=chr( 170);
$tempchar=$tempchar1.$tempchar2;
$string=ereg_replace( $tempchar,"Ъ" , $string);
//echo "tempmygk=$tempchar";
$tempchar2=chr( 171);
$tempchar=$tempchar1.$tempchar2;
// $string=ereg_replace( $tempchar3,$tempchar, $string);
$string=ereg_replace( $tempchar,"Ы" , $string);
//echo "tempy=$tempchar";
$string=ereg_replace("Р" , "Э" , $string);
$string=ereg_replace( "Р®" , "Ю" , $string);
$string=ereg_replace( "РЇ" , "Я" , $string);
// small
$string=ereg_replace( "Р°" ,"а" , $string);
$string=ereg_replace( "Р±" ,"б" , $string);
$string=ereg_replace( "РІ" ,"в" , $string);
$string=ereg_replace( "Рі" ,"г" , $string);
$string=ereg_replace( "Рґ" , "д" , $string);
$string=ereg_replace( "Рµ" ,"е" , $string);
$string=ereg_replace( "Рµ" ,"ё" , $string);
// $string=ereg_replace( "С'" , "ё" , $string);
$string=ereg_replace( "Р¶" , "ж" , $string);
$string=ereg_replace( "Р·" , "з" , $string);
$string=ereg_replace( "Рё" ,"и" , $string);
$string=ereg_replace( "Р№" ,"й" , $string);
$string=ereg_replace("Рє" , "к" , $string);
$string=ereg_replace( "Р»" , "л" , $string);
$string=ereg_replace( "Рј" , "м" , $string);
$string=ereg_replace( "РЅ" , "н" , $string);
$string=ereg_replace( "Рѕ" , "о" , $string);
$string=ereg_replace("Рї" , "п" , $string);
$string=ereg_replace("СЂ" , "р" , $string);
$string=ereg_replace("СЃ" , "с" , $string);
$string=ereg_replace( "С‚" , "т" , $string);
$string=ereg_replace( "Сѓ" , "у" , $string);
$string=ereg_replace( "С„" , "ф" , $string);
$string=ereg_replace( "С…" , "х" , $string);
$string=ereg_replace( "С†" , "ц" , $string);
$string=ereg_replace( "С‡" , "ч" , $string);
$string=ereg_replace( "С?" , "ш" , $string);
$string=ereg_replace( "С‰" , "щ" , $string);
$string=ereg_replace( "СЊ" ,"ь" , $string);
$string=ereg_replace( "С‹" , "ы" , $string);
$string=ereg_replace( "СЉ" , "ъ" , $string);
$string=ereg_replace( "СЌ" , "э" , $string);
$string=ereg_replace( "СЋ" , "ю" , $string);
$string=ereg_replace("СЏ" , "я" , $string);
$string=ereg_replace("Р " , "Р" , $string);
+69.6
$s = mysql_query('SELECT * FROM `nazva_stolbca` where `nazva_stolbca` = `$_GET['name']`');
if ($s == '' ) { echo 'такого значения нет'};
Я боюсь :(
+54
$k = "\$user->".$rowField->name;
eval("\$k = \"$k\";");
if ( !$k && $k !== '0' ) {
...
}
ребята не в курсе)
+152
if ($view == 0) {
render_blocks($side, $blockfile, $title, $content, $bid, $bposition);
} elseif ($view == 1 && $CURUSER) {
render_blocks($side, $blockfile, $title, $content, $bid, $bposition);
} elseif ($view == 2 && (get_user_class() >= UC_MODERATOR)) {
render_blocks($side, $blockfile, $title, $content, $bid, $bposition);
} elseif ($view == 3 && (!$CURUSER || get_user_class() >= UC_MODERATOR)) {
render_blocks($side, $blockfile, $title, $content, $bid, $bposition);
}
Закодированный кусок с трекера TBDev Yuna Edition.(include/blocks.php)