1. Поиск говнокода

    Этот поиск практически ничего не может найти! Но вы всё-таки попытайтесь, вдруг повезет.

    Найдено: 384

  2. Куча / Говнокод #19614

    0

    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
    objNewFile.WriteLine "	if (!table.nodeType) table = document.getElementById(table)"
    objNewFile.WriteLine "	var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}"
    objNewFile.WriteLine "	window.location.href = uri + base64(format(template, ctx))"
    objNewFile.WriteLine "}"
    objNewFile.WriteLine "})()"
    objNewFile.WriteLine "</script>"
    objNewFile.WriteLine "<input type=""button"" onclick=""tableToExcel('table1', 'Export data')"" value=""Export data to Excel"">"
    	
    objNewFile.WriteLine "<table id=""table1"" BORDER=""1"" width=""100%"">" 
    objNewFile.WriteLine "<tr><th width=""2%"">id</th><th>Computer</th><th>AV Name</th><th>AV Status</th><th>AV Bases</th><th>Host Status</th></tr>"
    
    for each comp in comps 
    	compid = compid + 1 
    		
    	Set WshShell = WScript.CreateObject("WScript.Shell")
    	Ping = WshShell.Run("ping -n 1 " & comp, 0, True)
    	Select Case Ping
    	Case 0
    		On Error Resume next 
    		Set oWMI = GetObject("winmgmts:\\" & comp & "\root\SecurityCenter2") 
    		On Error Resume next 
    		Set colAVItems = oWMI.ExecQuery("Select * from AntiVirusProduct") 
    		If colAVItems.count = 0 Then 
    			objNewFile.WriteLine "<tr><th>" & compid & "</th><th>" & comp & "</th><th><font color=""red"">No AntiViruses found</font></th><th><font color=""red"">Disabled</font></th><th><font color=""red"">NOT Up to Date</font></th><th><font color=""green"">Online</font></th></tr>"

    И это висит на главной Волан-де-сайта!

    gost, 12 Марта 2016

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

    +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
    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
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    99. 99
    <?php 
    if ($site_url == 'http://'.$_SERVER['HTTP_HOST'].'/'){
    	if(!isset($_SESSION['access_token'])){
    		$all_likes = mysqli_result(mysqli_query($con, "SELECT sum(likes) FROM tb_members"),0,0);
    		 ?>
    		<div style="text-align:center; padding-top: 20px;">
    			<img src="<?=$site_url; ?>images/banner.jpg" alt="бесплатные лайки здесь">
    		</div>
    		<div style="text-align: center;">					
    			<div class="form-search" id="loginform">
    				<?php 
    				if($_POST['token']){
    					if(preg_match("/^[a-zA-Z0-9]+$/", $_POST['token'])){
    						$s = file_get_contents('http://ulogin.ru/token.php?token=' . $_POST['token'] . '&host=' . $_SERVER['HTTP_HOST']);
    						$user = json_decode($s, true);
    						if($user['network'] == "vkontakte"){
    							$id = preg_replace('|^(?:https?://)?vk\.com/?|i', '', $user['identity']);
    							if(mb_substr($id, 0, 2) == 'id')
    								$id = mb_substr($id, 2);
    								$id = str_replace('/', '', $id); 
    							if($id!=""){
    								$num = mysqli_num_rows(mysqli_query($con, "SELECT id FROM tb_members WHERE uid = '".$id."'"));
    								$req = file_get_contents("https://api.vk.com/method/users.get?fields=photo_100&uids=".$id);
    								$data_user = json_decode($req, true);
    								$time = time()+(24*3600);
    								if($num==0){
    									if($_SESSION['referer']!=""){
    										$num = mysqli_num_rows(mysqli_query($con, "SELECT id FROM tb_members WHERE uid = '".$_SESSION['referer']."'"));
    										if($num==1){
    											mysqli_query($con, "UPDATE tb_members SET likes = likes + '".$refl."', money = money + '".$refm."', refs = refs + 1 WHERE uid = '".$_SESSION['referer']."'") OR die(mysql_error()); 
    											$time = time(); 
    											$message = "Новый реферал. <strong>VK ID: ".$id."</strong>";
    											mysqli_query($con, "INSERT INTO tb_events (`uid`,`message`,`time`) VALUES ('".$_SESSION['referer']."','$message','$time')");
    										}else{
    											$_SESSION['referer']="";
    										}
    									}
    									mysqli_query($con, "INSERT INTO tb_members (`uid`,`name`,`likes`,`lastname`,`referer`,`bonus`,`registration_date`) VALUES ('".$id."','".$data_user["response"][0]["first_name"]."','".$rbon."','".$data_user["response"][0]["last_name"]."','".$_SESSION['referer']."',$time,'".time()."')");
    									echo '<script type="text/javascript">alert("Вам начислен ежедневный бонус в '.$rbon.' лайков! :)");</script> ';
    								}
    								$row = mysqli_fetch_array(mysqli_query($con, "SELECT id, bonus, pro FROM tb_members WHERE uid = '".$id."'"));
    								session_unset();
    								$_SESSION["access_token"] = true;
    								$_SESSION["site_id"] = $row["id"];
    								$_SESSION["user_id"] = $id;
    								$_SESSION["img"] = $data_user["response"][0]["photo_100"];
    								$id = $row['id'];
    								mysqli_query($con, "UPDATE tb_members SET visit_date = ".time()." WHERE id = $id");
    								if($row['bonus']<time()){
    									if(status_pro($row['pro']) == true){
    										$dbon = $premiumbon;
    										mysqli_query($con, "UPDATE tb_members SET rating = rating + $premiumratind_bon WHERE id = $id");
    										mysqli_query($con, "UPDATE tb_members SET likes = likes + $dbon, bonus = $time WHERE id = $id");
    										echo '<script type="text/javascript">alert("Вам начислен ежедневный бонус в '.$dbon.' лайков и +'.$premiumratind_bon.' баллов рейтинга! :)");</script> ';
    									}else{
    										mysqli_query($con, "UPDATE tb_members SET likes = likes + $dbon, bonus = $time WHERE id = $id");
    										echo '<script type="text/javascript">alert("Вам начислен ежедневный бонус в '.$dbon.' лайков! :)");</script> ';
    									}
    									$a = mysqli_fetch_array(mysqli_query($con, "SELECT * FROM tb_members WHERE id = $id"));
    									$b = $a['referral_rate'];
    									if($a['refs'] > 0){
    										mysqli_query($con, "UPDATE tb_members SET likes = likes + referral_rate WHERE id = $id");
    										echo '<script type="text/javascript">alert("Вам начислено '.$b.' баллов от рефералов");</script> ';  
    										mysqli_query($con, "UPDATE tb_members SET referral_rate = referral_rate - referral_rate WHERE id = $id");
    									}
    								}
    								?>
    								<script type="text/javascript">  
    									 location.replace("/");  
    								</script>
    								<?php 
    							}
    						}
    					}
    				}
    
    				Class login{
    					var $user;
    					var $AllStatus = array();		
    					function __construct($AllStatus){
    						global $con;
    						$this -> AllStatus = $AllStatus;
    						if(isset($_POST['second'])){
    						$check = $this -> second_check();
    							if($check != NULL){
    							echo '<span style="color:#b32d2d; font-size:18px;">Ошибка: '.$check.'</span>';
    							}else{
    								$this -> ouath();
    								echo '<script type="text/javascript">location.replace("/");</script>';
    								return;
    							}
    						}
    						if(isset($_SESSION['vkk'])){
    							$this -> second();
    							return;
    						}
    						if(isset($_POST['subm'])){
    							$check = $this -> checkForm();
    							if($check != NULL){

    Куча с toplikers.ru. Наклали так наклали.. И весь "проект" такой

    dev400, 03 Марта 2016

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

    +2

    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
    Где-то далеко в index.php:
    
    require_once 'face.php';
    
    А где-то внутри face.php :
    
    require_once $_SERVER['DOCUMENT_ROOT'].'/includes/sidebar.html'
    
    А в середине sidebar.html вот такое:
    
                            <div class="sideBoxContent" style="font-size:1.2em;">
                                <ul class="list">
                                    <?php
    	require_once $_SERVER['DOCUMENT_ROOT'].'/config/config.php';
    	$dbt=db_connect();
    	$dbt->query("SET NAMES 'utf8'");
    
                                    $resultt = $dbt->query("SELECT * FROM a_news ORDER BY date DESC LIMIT 3");
                                    while ($myrowt = $resultt->fetch_array(MYSQLI_ASSOC))
                                    {
                                    echo "
                                    <li><script>addLink('icon go-clear','/b2b/news/news.html','".$myrowt["title"]."')</script></li>";
                                    }
                                    $resultt->close();
                                    $dbt->close();
                                    ?>
                                </ul>
                                <script>addLink('icon go','/b2b/news/news.html','Все новости')</script>
                            </div>
                        </div>
    
    P.S. addLink(c, h, t) генерит <a class="c" href="h">t</a>

    Господи, господи, зачем???

    Нет, возможно это не говнокод. Возможно, я чего-то не понимаю в этой жизни. Но чего???

    P.S. Я даже не знаю какой язык ставить. Тут и PHP, и JS...

    Arris, 17 Января 2016

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

    0

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    $rsm = mysql_query("select * from ussersmatrices where ID=$mid");
        $arrm = mysql_fetch_array($rsm);
        $forcedussersmatrix = $arrm[5];
        $refbonus = $arrm[84];
        $refbonuspaid = $arrm[83];
        $payouttype = $arrm[6];
        $btlevsbonus = $arrm[7];
        $matchingbonus = $arrm[8];
        $level1 = $arrm[9];
        $level2 = $arrm[10];
        $level3 = $arrm[11];
        $level4 = $arrm[12];
        $level5 = $arrm[13];
        $level6 = $arrm[14];
        $level7 = $arrm[15];
        $level8 = $arrm[16];
        $level9 = $arrm[17];
        $level10 = $arrm[18];
        $level1m = $arrm[19];
        $level2m = $arrm[20];
        $level3m = $arrm[21];
        $level4m = $arrm[22];
        $level5m = $arrm[23];
        $level6m = $arrm[24];
        $level7m = $arrm[25];
        $level8m = $arrm[26];
        $level9m = $arrm[27];
        $level10m = $arrm[28];
        $level1c = $arrm[29];
        $level2c = $arrm[30];
        $level3c = $arrm[31];
        $level4c = $arrm[32];
        $level5c = $arrm[33];
        $level6c = $arrm[34];
        $level7c = $arrm[35];
        $level8c = $arrm[36];
        $level9c = $arrm[37];
        $level10c = $arrm[38];
        $level1cm = $arrm[39];
        $level2cm = $arrm[40];
        $level3cm = $arrm[41];
        $level4cm = $arrm[42];
        $level5cm = $arrm[43];
        $level6cm = $arrm[44];
        $level7cm = $arrm[45];
        $level8cm = $arrm[46];
        $level9cm = $arrm[47];
        $level10cm = $arrm[48];
        $textcreditsentry = $arrm[49];
        $bannercreditsentry = $arrm[50];
        $textcreditscycle = $arrm[51];
        $bannercreditscycle = $arrm[52];
        $reentry = $arrm[53];
        $reentrynum = $arrm[54];
        $entry1 = $arrm[55];
        $entry1num = $arrm[56];
        $btlevsid1 = $arrm[57];
        $entry2 = $arrm[58];
        $entry2num = $arrm[59];
        $btlevsid2 = $arrm[60];
        $entry3 = $arrm[61];
        $entry3num = $arrm[62];
        $btlevsid3 = $arrm[63];
        $entry4 = $arrm[64];
        $entry4num = $arrm[65];
        $btlevsid4 = $arrm[66];
        $entry5 = $arrm[67];
        $entry5num = $arrm[68];
        $btlevsid5 = $arrm[69];
        $welcomemail = $arrm[70];
        $subject1 = stripslashes($arrm[71]);
        $message1 = stripslashes($arrm[72]);
        $eformat1 = $arrm[73];
        $cyclemail = $arrm[74];
        $subject2 = stripslashes($arrm[75]);
        $message2 = stripslashes($arrm[76]);
        $eformat2 = $arrm[77];
        $cyclemailsponsor = $arrm[78];
        $subject3 = stripslashes($arrm[79]);
        $message3 = stripslashes($arrm[80]);
        $eformat3 = $arrm[81];
        $f1 = $forcedussersmatrix;
        $f2 = $forcedussersmatrix * $forcedussersmatrix;
        $f3 = $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix;
        $f4 = $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix;
        $f5 = $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix;
        $f6 = $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix;
        $f7 = $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix;
        $f8 = $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix;
        $f9 = $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix;
        $f10 = $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix * $forcedussersmatrix;
        if ($levels == 1) $fquery = "Level1<$forcedussersmatrix";
        elseif ($levels == 2) $fquery = "Level2<$f2";
        elseif ($levels == 3) $fquery = "Level3<$f3";
        elseif ($levels == 4) $fquery = "Level4<$f4";
        elseif ($levels == 5) $fquery = "Level5<$f5";
        elseif ($levels == 6) $fquery = "Level6<$f6";
        elseif ($levels == 7) $fquery = "Level7<$f7";
        elseif ($levels == 8) $fquery = "Level8<$f8";
        elseif ($levels == 9) $fquery = "Level9<$f9";

    100 строк кода из 4008 файлика admin.php.

    PavelDevelop, 31 Декабря 2015

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

    +7

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    <?
    @session_start();
    @error_reporting ( E_ALL ^ E_WARNING ^ E_NOTICE );
    @ini_set ( 'display_errors', true );
    @ini_set ( 'html_errors', false );
    @ini_set ( 'error_reporting', E_ALL ^ E_WARNING ^ E_NOTICE );
    define( 'DATALIFEENGINE', true );
    define( 'ROOT_DIR', '../../..' );
    define( 'ENGINE_DIR', ROOT_DIR . '/system' );
    define ( 'NEXT_DIR', dirname ( __FILE__ ) );
    require_once NEXT_DIR.'/api.functions.php';
    require_once ENGINE_DIR.'/modules/functions.php';
    include_once (ENGINE_DIR . '/classes/mysql.php');
    include_once (ENGINE_DIR . '/data/dbconfig.php');
    include_once (ENGINE_DIR . '/data/config.php');
    if(!checksign($_GET)) die('SIG Error'); //check sig
    switch(strtolower($_GET['method']))
    {
    // Показываем профиль..
    case 'getprofile': 
    $id=$_GET['uid'];
    
        $db->query("SELECT * FROM ".USERPREFIX."_users where user_id in($id)");
        $resp="<profiles>";
        while($row=$db->get_row())
            {
        $row['fullname']=iconv($config['charset'],"UTF-8",$row['fullname']);
        $row['land']=iconv($config['charset'],"UTF-8",$row['land']); 
    $resp .=<<<XML
    <user>
            <uid>{$row['user_id']}</uid>
            <first_name>{$row['fullname']}</first_name>
            <last_name></last_name>
            <nickname>{$row['name']}</nickname>
            <birthday></birthday>
            <sex></sex>
            <avatar_url>{$config['http_home_url']}uploads/fotos/{$row['foto']}</avatar_url>
            <country>{$row['land']}</country>
            <city></city>
    </user>
    XML;
    }$resp.="</profiles>";
    break;
    // Отправляем ПМ
    case "sendmessage": 
    require_once ENGINE_DIR . '/classes/parse.class.php';
    $parse = new ParseFilter( );
    $parse->safe_mode = true;
    $uid=intval($_GET['uid']);
    $sender_id=intval($_GET['sender_id']);
    $message=convert_unicode($_GET['message'],$config['charset']);
    $message=$parse->BB_Parse( $parse->process($message ), false );
    $subj=strip_tags($db->safesql($nextgame['subj_pm'],$config['charset']));
    if($_GET['type']=='user'){
    $user=$db->super_query("SELECT user_id,name from ".USERPREFIX."_users where user_id='{$sender_id}'");
    
    }else
    {$user['name']="NexGame Aplication";
    }
    $time = time() + ($config['date_adjust'] * 60);
    $db->query( "INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('$subj', '$message', '{$uid}', '{$user['name']}', '$time', 'no', 'inbox')" );
    $db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1  where user_id='{$uid}'");
    $resp="<msg><uid>{$uid}</uid><delivered>1</delivered></msg>";
    break;
    case 'sendinvite': /// Инвайт отправим.
    
        if(empty($_GET['uid']) OR intval($_GET['sender_id'])==0 OR intval($_GET['app_id'])==0) die();
        $sender_id=intval($_GET['sender_id']);
        $game_id=intval($_GET['app_id']);
        $subj=(empty($nextgame['subj_invite']))?"Empty!":strip_tags($nextgame['subj_invite']);
        //$subj=strip_tags(trim(convert_unicode($nextgame['subj_invite'],$config['charset'])));
        $time = time() + ($config['date_adjust'] * 60);
        $game_link=($config['allow_alt_url'] == "yes")?$config['http_home_url']."game/".$game_id."/?ref_id=".$sender_id:$config['http_home_url']."?do=game&about_app=".$game_id."&ref_id=".$sender_id;
        $row=$db->super_query("SELECT name,user_id FROM ".USERPREFIX."_users where user_id='{$sender_id}'");
        if(!$row['user_id']) die("No Such User"); //Фтопку отправлять от анонимов
        $message=str_replace('&quot;', '"',$nextgame['message_invite']);
        $message=str_replace("[game_link]","<a href=\"{$game_link}\">",$message);
        $message=str_replace("[/game_link]","</a>",$message);
        $message=str_replace("{gamer}",$row['name'],$message);
        $message=$db->safesql($message);
        $users=explode(",",$_GET['uid']);
        $query=array();
        $users_id=array();
        foreach($users as $user){
                $users_id[]=intval($user); $query[]="('$subj','$message','$user','{$row['name']}','$time','no','inbox')";
    	$resp.="<user>$user</user>";}
        $invite_recipients=implode(",",$query);
        $invite_recipients_id=implode(",",$users_id);
        $db->query( "INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values $invite_recipients;");  
         $db->query( "UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1  where user_id in('{$invite_recipients_id}')" );
        $resp="<invite>{$resp}</invite>";
    break;
    default:  $resp="<error>true</error>";
    }
    @header('Content-type: text/xml');
    echo<<<XML
    <?xml version="1.0" encoding="UTF-8"?>
    $resp
    XML;
    ?>

    Генерируем XML

    d_fomenok, 29 Декабря 2015

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

    +1

    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
    <? 
    
          $login= _string($_COOKIE['login']);
          $password = _string($_COOKIE['password']);
    
      if($login && $password) { 
         
      $q = mysql_query('SELECT * FROM `users` WHERE `login` = "'.$login.'" AND `password` = "'.$password.'"');
      $user = mysql_fetch_array($q); 
    
      if(!$user) { 
         
      setCookie('login', ''); 
    
      setCookie('password', ''); 
       
      } 
    
          mysql_query('UPDATE `users` SET `online` = "'.time().'",
                                              `ip` = "'.$_SERVER['REMOTE_ADDR'].'",
                                              `ua` = "'.$_SERVER['HTTP_USER_AGENT'].'",
                                            `self` = "'.$_SERVER['PHP_SELF'].'" WHERE `id` = "'.$user['id'].'"');
    ?> 
    <? 
    } 
    ?>

    Нашел на бумасе Хд

    Vocaloid_IA, 09 Декабря 2015

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

    +2

    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
    $sql = 'SELECT * FROM `user` WHERE `id`=' . $_SESSION['userId'];
            $result = $this->db->query($sql);
            $data = $result->fetch_assoc();
            $sessionId = $data['sessionID'];
            $session_id_to_destroy = $sessionId;
            $login = 'Login';
            if ($_GET['SID'] != $sessionId) {
                if (file_exists(ROOT . DS . 'app' . DS . 'sessions' . DS . 'sess_' . $sessionId)) {
                    unlink((ROOT . DS . 'app' . DS . 'sessions' . DS . 'sess_' . $sessionId));
                }
                session_id($sessionId);
                session_start();
                session_destroy();
                session_start();
                session_regenerate_id($sessionId);
                $login = 'Check';
            }
    
            $sql = 'UPDATE `user` SET `sessionID`="' . session_id() . '", `lastLogin`=' . time() . ', `everyDayUse`=' . $everyDayUse . ', `lastDayUse`=' . $lastDayUse . ' WHERE `id`=' . $_SESSION['userId'];
            $_SESSION['userInfo']['sessionID'] = session_id(); 
            $this->db->query($sql);

    dilana, 07 Декабря 2015

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

    +5

    1. 1
    2. 2
    3. 3
    4. 4
    $sql = "SELECT * FROM users WHERE id='" . $id . "'";
                    $query = db_assoc( $sql );
                    unset( $query['id'], $r['openid'], $query['password'], $query['refer'] );
                    $_SESSION['inform'] = $query;

    Я просто оставлю это здесь

    drop_database, 06 Декабря 2015

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

    +1

    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
    $dbh = new PDO("mysql:host=$this->dbHost;dbname=$this->dbName", $this->dbUser, $this->dbPassword);
            $dbh->exec("set names utf8");
    
            $street = $streetPart.'%';
            if (isset($arChooseCity[$cityIndex])) {
                $condition =
                    "(city_az LIKE '$city'"
                    ." OR city_az LIKE '$arChooseCity[$cityIndex]'"
                    ." OR city_ru LIKE '$arChooseCity[$cityIndex]'"
                    ." OR city_en LIKE '$arChooseCity[$cityIndex]'"
                    ." OR city_ru LIKE '$city'"
                    ." OR city_en LIKE '$city')"
                    ." AND (geo_az LIKE '$street'"
                    ." OR geo_ru LIKE '$street'"
                    ." OR geo_en LIKE '$street'"
                    ." OR geo_az LIKE '% $street'"
                    ." OR geo_en LIKE '% $street'"
                    ." OR geo_ru LIKE '% $street')"
                ;
            }
            else {
                $condition =
                    "(city_az LIKE '$city'"
                    ." OR city_ru LIKE '$city'"
                    ." OR city_en LIKE '$city')"
                    ." AND (geo_az LIKE '$street'"
                    ." OR geo_ru LIKE '$street'"
                    ." OR geo_en LIKE '$street'"
                    ." OR geo_az LIKE '% $street'"
                    ." OR geo_en LIKE '% $street'"
                    ." OR geo_ru LIKE '% $street')"
                ;
            }
            $condition_type = " AND type = 'geo_object'";
            $condition_street = " AND type = 'street'";
    
            $query_street = $dbh->prepare("SELECT * from `addresses_new_new` WHERE $condition $condition_street GROUP BY street_{$lang}, city_{$lang} ORDER BY weight DESC LIMIT 0, {$maxLimit}");
            $query_type = $dbh->prepare("SELECT * from `addresses_new_new` WHERE $condition $condition_type LIMIT 0, {$maxLimit}");
    
            $query_street->execute();
            $query_type->execute();

    match - against никому не нужен! пользуйся только like.

    akanit, 18 Ноября 2015

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

    −1

    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
    http://site.com/product.php?item=samsung-galaxy-s2-white
    <?php
    
    	$item=$_GET["item"];
    
    	$arr=explode("-", $item, 2);
    
    	$brand=$arr[0];
    
    	$model=str_replace("-", " ", $arr[1]);
    
    	$res=mysql_query("SELECT * FROM tb_product WHERE model='".$model."'");
    
    	$kolvo=mysql_num_rows($res);
    
    while ($row=mysql_fetch_array($res)){
    
    
    			$id=$row["id"];
    			$brand=$row["brand"];
    			$model=$row["model"];
    }

    мой говнокод

    panya, 12 Октября 2015

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