- 1
- 2
- 3
- 4
- 5
- 6
- 7
$cif = range(0, 9);
$mal = range('a', 'z');
$bol = range('A', 'Z');
$ob = array_merge($cif, $mal, $bol);
shuffle($ob);
$ar = array_slice($ob,0, 5);
$vivod = implode("", $ar);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+153
$cif = range(0, 9);
$mal = range('a', 'z');
$bol = range('A', 'Z');
$ob = array_merge($cif, $mal, $bol);
shuffle($ob);
$ar = array_slice($ob,0, 5);
$vivod = implode("", $ar);
Очередной генератор капчи/пароля.
Вдруг кому пригодится ;)
+167
while(!file_exists(getcwd()."/.htroot")){chdir('..');}
http://www.php.net/manual/en/function.require.php
if you want always include, require, open files using some 'root' folder based path you may may put file '.htroot' in 'root' folder and use this.
while(!file_exists(getcwd()."/.htroot")){chdir('..');}
This code change current dir to dir where '.htroot' file located and everywhere you can use relative to 'root' paths.
Please avoid absent of '.htroot' file.
+33
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1251">
<meta http-equiv="Pragma" content="no-cache">
<link rel=File-List href="SL_php2weeks_box.files/filelist.xml">
<title>PHP за 2 недели - курс обучения PHP от Школы Программирования</title>
<style type="text/css">
<!--
.style1 {font-family: Georgia, "Times New Roman", Times, serif}
.style5 {font-family: Georgia, "Times New Roman", Times, serif; font-style: italic; }
.style6 {font-family: Georgia, "Times New Roman", Times, serif; font-weight: bold; }
.style7 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style8 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
font-style: italic;
color: #009000;
}
.style9 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 18px;
}
.style10 {
font-family: "Courier New", Courier, monospace;
font-size: 12px;
}
.style11 {
font-size: 24px;
font-weight: bold;
}
.style12 {font-size: 24px; font-weight: bold; font-family: Georgia, "Times New Roman", Times, serif; }
.style13 {font-size: 24px; font-weight: bold; font-family: Georgia, "Times New Roman", Times, serif; font-style: italic; }
.style14 {font-family: Georgia, "Times New Roman", Times, serif; font-weight: bold; font-style: italic; }
.style15 {
color: #0000FF;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style17 {font-family: Georgia, "Times New Roman", Times, serif; font-style: italic; font-size: 16px; }
.style18 {
font-size: 20px
}
-->
</style>
</head>
<body lang=RU link=blue vlink=purple>
<!-- SmartResponder.ru PopOver code (begin) -->
<script language="javascript" type="text/javascript" src="popover.js"></script>
<span style="margin: 0pt; padding: 0pt; width: 400px; height: 400px; position: absolute; left: 0pt; top: 0pt; right: 0pt; z-index: 1; display: none;" id="SR_PopOver">
<table cellpadding="0" cellspacing="0" height="246" width="400">
<tbody>
<tr>
<td style="border: 1px solid rgb(0, 0, 0);">
<table bgcolor="#ffffff" cellpadding="3" cellspacing="0" height="100%" width="100%">
<tbody>
<tr bgcolor="#dddddd" valign="middle">
<td onMouseDown="popover_drag_start(event, this, 'SR_PopOver')" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 255); font-weight: bold;" align="center" width="100%">
<b>Подарок Вам - <font style="color:#009000;">Курс Web-Старт!</font><br /> 7 Бесплатных Видеоуроков По PHP!</b></td>
<td align="right">
<table cellspacing="0">
<tbody>
<tr>
<td style="padding: 0pt 3px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0); font-weight: bold;" onClick="popover_close(this, 'popover_start_to(\'SR_PopOver\', 21, 0, \'windowWidth\', parseInt(popover_obj.style.top) - popover_base_y)')" onMouseOver="this.style.cursor='pointer'" onMouseOut="this.style.cursor='default'">X</td>
</tr>
</tbody>
</table>
http://prog-school.ru/php2weeks/
вот как бывает! исходник страницы смотрите сами :)
+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)
не ( белую страничку выдает*/
Я был в шоке)))