1. PHP / Говнокод #4959

    +163

    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
    <?php
    // Заменить значния, выделенные жирным на действительные
    // Соединяемся с "Мускулом"
     define("MYSQL_HOST","myhost.ru",true);
     define("MYSQL_USER","username",true);
     define("MYSQL_PASS","userpass",true);
     define("MYSQL_DB_N","userdb",true);
     define("MYSQL_DB_N","userstable",true);
     $_MYSQL_CONNECT = false; $_MYSQL_ERROR = -1;
     if ($_MYSQL_CONNECT = @mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS))
     {
      if (mysql_select_db(MYSQL_DB_N,$_connect))
      {
       $_MYSQL_ERROR = 0; define("MYSQL_CONNECTED",true,true);
      } else { $_MYSQL_ERROR = 2; define("MYSQL_CONNECTED",false,true); }
     } else { $_MYSQL_ERROR = 1; define("MYSQL_CONNECTED",false,true); }
    // Проверяем значение
    // Определяем список разрешённых неалфавитноцифровых символов
     $_SRCH[0] = '.'; $_SRCH[1] = '_'; $_SRCH[2] = '-'; $_SRCH[3] = ' ';
     if (isset($_POST['user']))
     {
      $_tmp = iconv("UTF-8","CP1251//IGNORE",urldecode($_POST['user']));
      if (ctype_alnum(str_replace($_SRCH,'',$_tmp)) && (strlen($_tmp) < 33))
      {
       if (MYSQL_CONNECTED)
       {
        $_query = 'SELECT * FROM '.MYSQL_US_N." WHERE nick='".$_tmp."'";
        if ($_result = mysql_query($_query,$_MYSQL_CONNECT))
        {
         if ($_row = mysql_fetch_assoc($_result))
         {
          define("_RESULT","RES_EX",true);
         } else { define("_RESULT","RES_OK",true); }
        } else { define("_RESULT","RES_MYSQL_BQ",true); }
       } else { define("_RESULT","RES_MYSQL_NC",true); }
      } else { define("_RESULT","POST_IN",true); }
     } else { define("_RESULT","POST_NS",true); }

    qbasic, 17 Декабря 2010

    Комментарии (58)
  2. PHP / Говнокод #4957

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    //Предосмотр
                $pre = '';
            if (1==1) {
                $prev_pic = str_replace('/', '--', iconv_substr(strstr($v['path'], '/'), 1));
    }

    ===ЗАГРУЗ-ЦЕНТР===
    # Автор : Sea
    # E-mail : [email protected]
    # ICQ : 355152215
    # Вы не имеете права распространять данный скрипт
    # По всем вопросам пишите в ICQ
    файл - search.php, строка 143

    4ibo, 17 Декабря 2010

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

    +160

    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
    if ($panel_array[$i] == 1)
    {
    	$tpl->add('USER_PANEL', $user_panel['load_img']);
    }
    elseif ($panel_array[$i] == 2)
    {
    	$tpl->add('USER_PANEL', $user_panel['manual']);
    }
    elseif ($panel_array[$i] == 3)
    {
    	$tpl->add('USER_PANEL', $user_panel['search']);
    }
    elseif ($panel_array[$i] == 4)
    {
    	$tpl->add('USER_PANEL', $user_panel['chat']);
    }
    elseif ($panel_array[$i] == 5)
    {
    	$tpl->add('USER_PANEL', $user_panel['faq']);
    }
    elseif ($panel_array[$i] == 6)
    {
    	$tpl->add('USER_PANEL', $user_panel['game']);
    }
    elseif ($panel_array[$i] == 7)
    {
    	$tpl->add('USER_PANEL', $user_panel['image']);
    }

    Снёс высотку, построил сарай

    Genka, 16 Декабря 2010

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

    +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
    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
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Scouting table</title>
    </head>
    <?php
    $t=floor((time()-1286582400)/86400);
    $a=17+floor($t/112);
    $b=(($t/112)-(floor($t/112)))*112;
    $c=17+floor(($t+1)/112);
    $d=((($t+1)/112)-(floor(($t+1)/112)))*112;
    $e=$a+1;
    $f=$e+1;
    {echo
    ("<table align=\"center\" border=\"1\">
      <tr align=\"center\">
        <td>Scouting table</td><td colspan=\"3\"> Scout by age</td>
      </tr>
       <tr align=\"center\">
        <td>Position</td><td>WC17 - 17 years 0 days - $a years $b days</td><td>WC16 - $c years $d days - $e years $b days</td><td>WC15 - $f years $d days - 20 years 111 days</td>
      </tr>
      <tr align=\"center\">
        <td>Goalkeepers</td><td>***** <a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
      </tr>
      <tr align=\"center\">
        <td>Defenders</td><td>***** <a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
      </tr>
      <tr align=\"center\">
        <td>Playmakers</td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
      </tr>
      <tr align=\"center\">
        <td>Wingers</td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>***** <a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
      </tr>
      <tr align=\"center\">
        <td>Forwards</td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td><td>*****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
      </tr>
    </table>
    <table align=\"center\">
      <tr align=\"center\">
        <td>Chief Scout: *****<a href=\"http://www.hattrick.org/Club/?TeamID=*****\">(*****)</a></td>
        </tr>
    </table>");}
    ?>
    
    <body>
    </body>
    </html>

    Вместо звездочек строки html) Замазал)

    vasya1, 16 Декабря 2010

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

    +164

    1. 1
    2. 2
    3. 3
    4. 4
    $_POST['img_src'] = explode("/", "", $_POST['img_src']);
    $_POST['img_src'] = $_POST['img_src'][count($_POST['img_src'])-1];
    $_POST['img_src'] = str_replace("_1", "", $_POST['img_src']);
    $user_file->tmp_insert($_POST['img_src']);

    Магия...

    advvzlol, 16 Декабря 2010

    Комментарии (12)
  6. PHP / Говнокод #4941

    +157

    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
    $query = "SELECT * FROM records WHERE  id_film='$id_film'";        
    $results = mysql_query($query);
    $var1 = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
    $var1 = $var1. "<playlist>\n";     
    while($line = mysql_fetch_assoc($results))
      {
    $tmp_us = $tmp_us.$line['id_user'];
      $var1 = $var1."<vid src=\"http://homelinux.com:8080/sample1/content/audiorecord/"
      . $line['id_user']
      ."/"
      . $line["file_name"]
      ."_d.flv"
      . "\" label=\""
      . $line["file_name"]
      ."\""
      ." id_film=\""
      . $line["id_film"]
      ."\""
      ." time_begin=\""
      . $line["time_begin"]
      ."\""
      ." time_end=\""
      . $line["time_end"]
      ."\""
      ." id_user=\""
      . $line["id_user"]
      ."\""  
      ." sh_val=\""
      . $line["sh_val"]
      ."\""
      ." id_record=\""
      . $line["id_record"]
      ."\""
      ."/>\n";
    }
    $var1 = $var1."</playlist>\n"; 
    echo "var1=$var1";

    Вот так некоторые Flash-еры формируют xml пакеты

    Agel_Nash, 16 Декабря 2010

    Комментарии (20)
  7. PHP / Говнокод #4940

    +160

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    function Add($WEB_FORM_ID, $arrVALUES=false, $CHECK_RIGHTS="Y", $USER_ID=false)
    {
    		global ... $_REQUEST, ...;
    ...
    }

    Битрикс

    elw00d, 16 Декабря 2010

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

    +162

    1. 1
    $str = strip_tags(htmlentities($str));

    простовато, но...
    Тэги не пройдут!!!

    fork, 15 Декабря 2010

    Комментарии (21)
  9. PHP / Говнокод #4934

    +158

    1. 1
    2. 2
    3. 3
    $where = "(`user_id` = ".$id." and `user_fr` = ".$user->Get('u_id').") or (`user_id` = ".$user->Get('u_id')." and `user_fr` = ".$id.")";
        
    $inc = array_merge($db->Select('friends', $where), $db->Select('friends_incoming', $where));

    Проверка на существования дружбы или предложений дружбы между двумя пользователями (каунтом $inc).

    Мартин, 15 Декабря 2010

    Комментарии (26)
  10. PHP / Говнокод #4931

    +162

    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
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    <?
    	if ($_GET['view'] == 'login') {
    		$_POST[email2] = htmlspecialchars(stripslashes($_POST[email]));
    		$_POST[pass2]  = htmlspecialchars(stripslashes($_POST[pass]));
    		if($_POST['email'] == $_POST['email2'] && $_POST['pass'] == $_POST['pass2']) {
    			if($_POST['email2'] && $_POST['pass2']) {				
    				$result_310 = mysql_query("SELECT * FROM `gameuser` WHERE `emailx` = '$_POST[email2]'");
    				$zapros_310 = mysql_fetch_array($result_310);
    				if($zapros_310['emailx']) {
    					if($zapros_310['passwordx'] != '' && $zapros_310['passwordx'] == md5($_POST['pass2'])) {
    						$ipd1       = $_SERVER["REMOTE_ADDR"];						
    						$result_105 = mysql_query("SELECT * FROM `ipblock` WHERE `ip` = '$ipd1'");
    						$zapros_105 = mysql_fetch_array($result_105);
    						if($zapros_105['id'] == '' && $zapros_105['ip'] != $ipd1) {
    							setcookie("iduser", $zapros_310['id']);
    							setcookie("emailuser", $zapros_310['emailx']);
    							setcookie ("passuser", $zapros_310['passwordx']);
    							
    							if($_COOKIE['code'])
    								if($_COOKIE['code'] != $zapros_310['id'])
    									mysql_query("INSERT INTO `statistic2` (info, date) VALUES ('".$_COOKIE['code']." change on ".$zapros_310['id']."', now());");
    							setcookie("code", $zapros_310['id'], time() + 2419200);
    							
    							$http_host5 = $_SERVER['HTTP_HOST'];
    							if ($http_host5 == 'dreamdivision.ru') {$http_host5 = "www.dreamdvision.ru";}
    							if ($http_host5 == 'dreamdivision.ru')     {$http_host5 = "www.dreamdivision.ru";}
    							if($zapros_310['id'] != '1') {$result_311 = mysql_query("UPDATE `gameuser` SET `ip` = '".$_SERVER["REMOTE_ADDR"]."', `host` = '$http_host5'  WHERE `id` = '$zapros_310[id]' LIMIT 1");}
    							$result_312 = mysql_query("SELECT * FROM `iploguser` WHERE `id` = '$zapros_310[id]'");
    							$zapros_312 = mysql_fetch_array($result_312);
    							if($zapros_312['ip'] != $ipd1) {
    								$result_313 = mysql_query("INSERT INTO `iploguser` ( `ip` , `id` ) VALUES ( '$ipd1', '$zapros_310[id]' );");
    							}
    							if ($zapros_310['tpcht'] == '0') {
    								$href1 = "updates.php";
    							} else if($zapros_310['tpcht'] == '1'){
    								$href1 = "main.php";
    							}
    							header("Location: $href1"); 
    						} else {
    							$smarty->assign('case', '2');
    							$smarty->assign('message', 'Пароль не верный.');
    							$smarty->display("index.tpl",$user_theme_name,$user_theme_name);
    						}
    					} else {
    						$smarty->assign('case', '2');
    						$smarty->assign('message', 'Пароль не верный.');
    						$smarty->display("index.tpl",$user_theme_name,$user_theme_name);
    					}
    				} else {
    					$smarty->assign('case', '2');
    					$smarty->assign('message', 'E-mail не верный.');
    					$smarty->display("index.tpl",$user_theme_name,$user_theme_name);
    				}
    			} else {
    				$smarty->assign('case', '2');
    				$smarty->assign('message', 'Заполните все поля.');
    				$smarty->display("index.tpl",$user_theme_name,$user_theme_name);
    			}
    		} else {
    			$smarty->assign('case', '2');
    			$smarty->assign('message', 'E-mail и/или Пароль содержат недопустимые символы.');
    			$smarty->display("index.tpl",$user_theme_name,$user_theme_name);
    		}
    	}
    $smarty->assign('case', '3');
    $smarty->display("index.tpl",$user_theme_name,$user_theme_name);

    qbasic, 15 Декабря 2010

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