- 1
die('<script LANGUAGE="JavaScript">location.replace("'.$url.'");');
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+168.9
die('<script LANGUAGE="JavaScript">location.replace("'.$url.'");');
Приветствуем победителя конкурса на самый извращенный редирект.
+151.2
<body onload="blinkAfterSearch();setTimeout('loadDummyImg()', 590000);var ex; try { startUpTasks(); } catch(ex) {}" />
Недавно отрыл в недрах нашего проекта! Try catch в onload!! :D
+171
$class = (preg_match("/^[0-9]+$/", $i/2)) ? "cssBgGrey" : "cssBgLightBlue";
Подсветка четных строк.
+60.9
return ((Dirty = (Buff = ((uint8 *)realloc (Buff, BuffLen = new_len))) !=0));
+144.8
void updateEach(void *ptr, void *unused)
chipmunk update method
chipmunk - физический движок (типа под iPhone) на сях. Прелесть, правда?
+169.8
if ( ( $_GET [ "lang" ] ) || ( $_POST [ "lang" ] ) )
{
if ( ( $_GET [ "lang" ] == "de" ) || ( $_POST [ "lang" ] == "de" ) ) { include ( "../language/german_setup.php" ); $lang = "de"; }
if ( ( $_GET [ "lang" ] == "en" ) || ( $_POST [ "lang" ] == "en" ) ) { include ( "../language/english_setup.php" ); $lang = "en"; }
if ( ( $_GET [ "lang" ] == "nl" ) || ( $_POST [ "lang" ] == "nl" ) ) { include ( "../language/dutch_setup.php" ); $lang = "nl"; }
if ( ( $_GET [ "lang" ] == "it" ) || ( $_POST [ "lang" ] == "it" ) ) { include ( "../language/italian_setup.php" ); $lang = "it"; }
if ( ( $_GET [ "lang" ] == "es" ) || ( $_POST [ "lang" ] == "es" ) ) { include ( "../language/spanish_setup.php" ); $lang = "es"; }
if ( ( $_GET [ "lang" ] == "fa" ) || ( $_POST [ "lang" ] == "fa" ) ) { include ( "../language/farsi_setup.php" ); $lang = "fa"; }
if ( ( $_GET [ "lang" ] == "dk" ) || ( $_POST [ "lang" ] == "dk" ) ) { include ( "../language/danish_setup.php" ); $lang = "dk"; }
if ( ( $_GET [ "lang" ] == "fr" ) || ( $_POST [ "lang" ] == "fr" ) ) { include ( "../language/french_setup.php" ); $lang = "fr"; }
if ( ( $_GET [ "lang" ] == "tr" ) || ( $_POST [ "lang" ] == "tr" ) ) { include ( "../language/turkish_setup.php" ); $lang = "tr"; }
if ( ( $_GET [ "lang" ] == "hu" ) || ( $_POST [ "lang" ] == "hu" ) ) { include ( "../language/hungarian_setup.php" ); $lang = "hu"; }
if ( ( $_GET [ "lang" ] == "pt" ) || ( $_POST [ "lang" ] == "pt" ) ) { include ( "../language/portuguese_setup.php" ); $lang = "pt"; }
if ( ( $_GET [ "lang" ] == "he" ) || ( $_POST [ "lang" ] == "he" ) ) { include ( "../language/hebrew_setup.php" ); $lang = "he"; }
}
else
{
include ( "../language/german_setup.php" ); # include language vars
$lang = "de";
}
Из известного php web stat релиза 2009 в июле.
В первом попавшимся на глаза скрипте.
+147.7
http://rmd.atdmt.com/tl/DocumentDotWrite.js
Оригинал http://thedailywtf.com/Articles/Amazingly-Brilliant-or-Incredibly-Stupid.aspx
+65.5
private static String getUTF8String(byte[] b, int off, int len) {
// First, count the number of characters in the sequence
int count = 0;
int max = off + len;
int i = off;
while (i < max) {
int c = b[i++] & 0xff;
switch (c >> 4) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
// 0xxxxxxx
count++;
break;
case 12: case 13:
// 110xxxxx 10xxxxxx
if ((int)(b[i++] & 0xc0) != 0x80) {
throw new IllegalArgumentException();
}
count++;
break;
case 14:
// 1110xxxx 10xxxxxx 10xxxxxx
if (((int)(b[i++] & 0xc0) != 0x80) ||
((int)(b[i++] & 0xc0) != 0x80)) {
throw new IllegalArgumentException();
}
count++;
break;
default:
// 10xxxxxx, 1111xxxx
throw new IllegalArgumentException();
}
}
if (i != max) {
throw new IllegalArgumentException();
....
В либе работы с зипом
+144.9
node_t* read_record(FILE *file) {
int success = 0;
node_t *record = 0;
do {
int nsz, dsz;
record = (node_t*)malloc(sizeof(node_t));
if (!record) {
break;
}
record->data = 0;
record->next = 0;
if (fread(&nsz, sizeof(int), 1, file) != 1 || feof(file)) {
break;
}
if (fread(record->name, 1, nsz, file) != nsz || feof(file)) {
break;
}
/* ... */
record->nsz = nsz;
record->dsz = dsz;
success = 1;
} while (0);
if (record && !success) {
free_list(record);
record = 0;
}
return record;
}
void write_record(FILE *file, node_t *record) {
int dsz = record->dsz;
int nsz = record->nsz;
if ((fwrite(&nsz, sizeof(int), 1, file) != 1) ||
(fwrite(record->name, 1, nsz, file) != nsz) ||
(fwrite(&csz, sizeof(int), 1, file) != 1) ||
(fwrite(record->data, 1, dsz, file) != dsz) ||
ferror(file)) {
fputs("Error: write_record", stderr);
}
}
+162.1
$cities_id=array(1,2,3,4,5,6);
$cities_name=array("MSK","SPB","NN","KZ","NOV","UFA");
GHTML::Run(array("html_autoinsert_on"=>0,"html_method"=>"_POST"));
print GHTML::Link("/test.php",null,GHTML::Link("/test.php","style='font-weight:bold;font-size:20px;'")->Html("[Главная]"))->Html("[Главная]");
print " ";
print GHTML::Link("/test.php?act=reg",null,GHTML::Link("/test.php?act=reg","style='font-weight:bold;font-size:20px;'")->Html("[Регистрация]"))->Html("[Регистрация]");
print GHTML::Form("POST","")
->HTML(
GHTML::Input("name","text","Имя пользователя",null,true)->Html(),
"<br>",
GHTML::Input("pass1","password","Пароль")->Html(),
"<br>",
GHTML::Input("pass2","password","Пароль ещё раз")->Html(),
"<br>",
GHTML::Select("city")->Html(
GHTML::Option("")->Html("Выберите город"),
GHTML::Option($cities_id,$_POST['city'])->Html($cities_name)
),
"<br>",
GHTML::CheckBoxList("che_cities[]",$cities_id,null,$_POST['che_cities'])->Html($cities_name),
"<br>",
GHTML::RadioList("r_cities[]",$cities_id,null,$_POST['r_cities'])->Html($cities_name),
"<br>",
GHTML::Textarea("resume",50,9,null,true)->Html("Ненмого о себе"),
"<br>",
GHTML::Input("","submit","Жми!")->Html()
);
//////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
<a href='/test.php' />[Главная]</a> <a href='/test.php?act=reg' style='font-weight:bold;font-size:20px;' />[Регистрация]</a><form method='POST' action='' /><input type='text' name='name' value='Имя пользователя' /><br><input type='password' name='pass1' value='Пароль' /><br><input type='password' name='pass2' value='Пароль ещё раз' /><br><select name='city' /><option value='' />Выберите город</option><option value='6' />MSK</option><option value='5' />SPB</option><option value='4' />NN</option><option value='3' />KZ</option><option value='2' />NOV</option><option value='1' />UFA</option></select><br><input type='checkbox' name='che_cities[]' value='6' />MSK<br /><input type='checkbox' name='che_cities[]' value='5' />SPB<br /><input type='checkbox' name='che_cities[]' value='4' />NN<br /><input type='checkbox' name='che_cities[]' value='3' />KZ<br /><input type='checkbox' name='che_cities[]' value='2' />NOV<br /><input type='checkbox' name='che_cities[]' value='1' />UFA<br /><br><input type='radio' name='r_cities[]' value='6' />MSK<br /><input type='radio' name='r_cities[]' value='5' />SPB<br /><input type='radio' name='r_cities[]' value='4' />NN<br /><input type='radio' name='r_cities[]' value='3' />KZ<br /><input type='radio' name='r_cities[]' value='2' />NOV<br /><input type='radio' name='r_cities[]' value='1' />UFA<br /><br><textarea name='resume' cols='50' rows='9' />Ненмого о себе</textarea><br><input type='submit' name='' value='Жми!' /></form>
хорошо что php гиппертекстовый ;)