- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
if( $user_id < 0 )
die( "I don't know you!" );
if( $action == '' )
die( "I don't know, what you want!" );
if( $action == 'login' )
die();
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+167
if( $user_id < 0 )
die( "I don't know you!" );
if( $action == '' )
die( "I don't know, what you want!" );
if( $action == 'login' )
die();
+178
function verifyQuery($sql, $con) {
if (!mysql_query($sql, $con)) {
echo "Error occured in verifyQuery() in sqlfunctions.php <br>";
echo "SQL sent : ";
echo $sql;
echo "<br>Database report: <br>";
die('Error: ' . mysql_error());
}
return mysql_query($sql, $con);
}
+162
//__________________________________
$id = $_POST['id'];
$fio = $_POST['fio'];
$adres = $_POST['adres'];
$pom = $_POST['pom'];
$s = $_POST['s'];
$data_dog = $_POST['data_dog'];
$stady = $_POST['stady'];
$prolоnga = $_POST['prolonga'];
$data = $_POST['data'];
$data_over = $_POST['data_over'];
$hows = $_POST['hows'];
$etazh = $_POST['etazh'];
$otn = $_POST['otn'];
$svid = $_POST['svid'];
//______________________________
$dt = array (
'id' => $id,
'fio' => $fio,
'adres' => $adres,
'pom' => $pom,
's' => $s,
'data_dog' => $data_dog,
'stady' => $stady,
'prolonga' => $prolonga,
'data' => $data,
'hows' => $hows,
'etazh' => $etazh,
'otn' => $otn,
'svid' => $svid,
);
//______________________________________
+160
<?
.....................
if (isset($_GET['show_info'])) {
$wpTimeMachineOptionsStorage['show_info'] = $_GET['show_info'];
}
if (isset($_GET['use_log'])) {
$wpTimeMachineOptionsStorage['use_log'] = $_GET['use_log'];
}
if (isset($_GET['show_options'])) {
$wpTimeMachineOptionsStorage['show_options'] = $_GET['show_options'];
}
if (isset($_GET['format'])) {
$wpTimeMachineOptionsStorage['format'] = $_GET['format'];
}
if (isset($_GET['use_post_pub'])) {
$wpTimeMachineOptionsStorage['use_post_pub'] = $_GET['use_post_pub'];
}
if (isset($_GET['use_timestamp_dir'])) {
$wpTimeMachineOptionsStorage['use_timestamp_dir'] = $_GET['use_timestamp_dir'];
}
if (isset($_GET['exclude_cache'])) {
$wpTimeMachineOptionsStorage['exclude_cache'] = $_GET['exclude_cache'];
}
if (isset($_POST['offsite'])) {
$wpTimeMachineOptionsStorage['offsite'] = $_POST['offsite'];
}
if (isset($_POST['remote_user'])) {
$wpTimeMachineOptionsStorage['remote_user'] = $_POST['remote_user'];
}
if (isset($_POST['remote_host'])) {
$wpTimeMachineOptionsStorage['remote_host'] = $_POST['remote_host'];
}
if (isset($_POST['remote_path'])) {
$wpTimeMachineOptionsStorage['remote_path'] = $_POST['remote_path'];
}
.....................
Плагин к Wordpress для бэкапов. Вроде свежий, умеет в DropBox и на Amazon S3 файлы класть, а вот поди ж ты.
+168
function test_file_for_smells( $filename )
{
global $MAX_FUNCTION_LINE_COUNT, $MAX_INDENTATION_LEVEL;
$function_line_count = 0;
$found_continued_line = 0;
$line_number = 0;
$fp = fopen( $filename, "r" );
if( ! $fp )
return;
while( ! feof( $fp ) )
{
$line = chop( fgets( $fp, 4096 ) );
$line_number++;
while( substr( $line, 0, 9 ) == "function " &&
substr( $line, strlen($line) - 1, 1 ) != ')' )
{
$line = $line . chop( fgets( $fp, 4096 ) )
$found_continued_line++;
}
if( substr( $line, 0, 9 ) == "function " )
{
$function_line_count = 1;
$function_name = substr( $line, 9, strpos($line, '(') - 9 );
}
if( $function_line_count > 0 )
{
if( $line == "\t}" )
{
$function_line_count = $function_line_count - 3;
if( $function_line_count > $MAX_FUNCTION_LINE_COUNT )
print_warning( $filename, $line, $line_number, "$function_name() too long ($function_line_count lines)" );
$function_line_count = 0;
}
else
$function_line_count++;
$result = test_line_for_indentation( $line, $MAX_INDENTATION_LEVEL );
if( ! $result )
print_warning( $filename, $line, $line_number, "Too much nesting." );
$result = test_line_for_function_definition( $line, $MAX_NUM_PARAMETERS );
if( ! $result )
print_warning( $filename, $line, $line_number, "Too many parameters." );
if( $found_continued_line > 0 )
{
$line_number += $found_continued_line;
$found_continued_line = 0;
}
}
}
}
Детектор говнокода!!!!
+145
$addon = array (
(function () { return range(0,24); }),
(function () { return range(0,31); })
);
print_r ( $addon[0]() );
Во, чё... А это чё?..
+172
/*Diablo (18:24:45 10/12/2010)
кароче я форму вынес в отдельный файл
Diablo (18:24:50 10/12/2010)
и хотел прицепить её так
Diablo (18:24:55 10/12/2010)*/
$addform = include "post_city.php";
echo ( "$addform" );
/*Aios (18:24:45 10/12/2010)
и как? работает?))*/
/*Diablo (18:24:50 10/12/2010)
не ( белую страничку выдает*/
Я был в шоке)))
+163
function replaceBBCodes($text){
$text=str_replace("/\n/m", "$0<br/>", $text);
$text = htmlspecialchars($text);
$text=nl2br($text);
$text=stripslashes($text);
$text=str_replace("!#3040#!", "&", $text);
$text=str_replace('[b]', '<strong>', $text);
$text=str_replace('[/b]', '</strong>', $text);
$text=str_replace('[i]', '<em>', $text);
$text=str_replace('[/i]', '</em>', $text);
$text=str_replace('[u]', '<u>', $text);
$text=str_replace('[/u]', '</u>', $text);
$text=str_replace('[s]', '<s>', $text);
$text=str_replace('[/s]', '</s>', $text);
$text=str_replace('[left]', '<span class="bb_left">', $text);
$text=str_replace('[/left]', '</span>', $text);
$text=str_replace('[right]', '<span class="bb_right">', $text);
$text=str_replace('[/right]', '</span>', $text);
$text=str_replace('[center]', '<span class="bb_center">', $text);
$text=str_replace('[/center]', '</span>', $text);
$text=str_replace('[justify]', '<span class="bb_justify">', $text);
$text=str_replace('[/justify]', '</span>', $text);
$text=preg_replace("#\[color=(.*?)](.*?)\[/color\]#si", '<span style="color:$1">$2</span>',$text);
$text=preg_replace("#\[size=(.*?)](.*?)\[/size\]#si", '<span style="font-size:$1px">$2</span>',$text);
$text=preg_replace("#\[a=(.*?)](.*?)\[/a\]#si", '<a href="$1">$2</a>',$text);
$text=preg_replace("#\[img=(.*?)](.*?)\[/img\]#si", '<img src="$2" alt="images" style="float:$1;margin:5px;" />',$text);
$text=preg_replace("#\[youtube](.*?)\[/youtube\]#si",'<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/$1"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>',$text);
$text=preg_replace("#\[youtube](.*?)\[/youtube\]#si",'<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/$1"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>',$text);
$text=preg_replace("#\[spoiler=(.*?)](.*?)\[/spoiler\]#si", '<div id=\'video\'><h1 class="headtt2" onclick="expandit(this)">$1</h1>
<div style="display:none;" class="sdsp"> $2</div> </div>', $text);
$text=preg_replace("#\[podspoiler=(.*?)](.*?)\[/podspoiler\]#si", '<h1 class="headtt" onclick="expandit(this)">$1</h1>
<div style="display:none;text-align:center">$2</div>', $text);
return $text;
}
+165
<?php
header("Content-Type: text/html; charset=windows-1251");
defined('_JEXEC') or die('<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/0.7.59</center>
</body>
</html>');
$url = $_SERVER['HTTP_HOST'];
$host = $_SERVER['DOCUMENT_ROOT'];
if(!file_exists($host."/data/conf.php")) die("Система не установленна!");
include $host.'/data/conf.php';
function generate_password($a)
{
if($a==1){
return rand(111111,99999999); }
else if($a==2){
$arr = array('a','b','c','d','e','f',
'g','h','i','j','k','l',
'm','n','o','p','r','s',
't','u','v','x','y','z',
); $pass = "";
$n = rand(6,10);
for($i = 0; $i < $n; $i++)
{
$index = rand(0, count($arr) - 1);
$pass .= $arr[$index];
}
return $pass; }
else if($a==3){
$arr = array('a','b','c','d','e','f',
'g','h','i','j','k','l',
'm','n','o','p','r','s',
't','u','v','x','y','z',
'A','B','C','D','E','F',
'G','H','I','J','K','L',
'M','N','O','P','R','S',
'T','U','V','X','Y','Z',
); $pass = "";
$n = rand(6,10);
for($i = 0; $i < $n; $i++)
{
$index = rand(0, count($arr) - 1);
$pass .= $arr[$index];
}
return $pass; }
else if($a==4){
$arr = array('a','b','c','d','e','f',
'g','h','i','j','k','l',
'm','n','o','p','r','s',
't','u','v','x','y','z',
'A','B','C','D','E','F',
'G','H','I','J','K','L',
'M','N','O','P','R','S',
'T','U','V','X','Y','Z',
'1','2','3','4','5','6',
'7','8','9','0',
); $pass = "";
$n = rand(10,16);
for($i = 0; $i < $n; $i++)
{
$index = rand(0, count($arr) - 1);
$pass .= $arr[$index];
}
return $pass; }
else if($a==5){
$arr = array('a','b','c','d','e','f',
'g','h','i','j','k','l',
'm','n','o','p','r','s',
't','u','v','x','y','z',
'A','B','C','D','E','F',
'G','H','I','J','K','L',
'M','N','O','P','R','S',
'T','U','V','X','Y','Z',
'1','2','3','4','5','6',
'7','8','9','0','.',',',
'(',')','[',']','!','?',
); $pass = "";
$n = rand(10,16);
for($i = 0; $i < $n; $i++)
{
$index = rand(0, count($arr) - 1);
$pass .= $arr[$index];
}
return $pass; }
} // генератор паролей
+168
<?php
...
$string = array();
...
?>