Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP][MYSQL]Nizeznany bład w lini.
Forum PHP.pl > Forum > PHP
MnicH.
Witam mam taki kod:
  1. <?php
  2. $game = $_GET['game'];
  3. $ip = $_GET['ip'];
  4. $port = $_GET['port'];
  5.  
  6. if(($game == '') or ($numer == '')){
  7. $db = mysql_connect( $db_server, $db_user, $db_pass );
  8. mysql_select_db( $db_name );
  9. $query = "SELECT * FROM `serwery` WHERE `ip`='$ip' AND `port`='$port'";
  10. $query = mysql_query($query) or die("Błąd w zapytaniu!");
  11. $wynik = mysql_fetch_array($query);
  12.  
  13.  
  14.  $language = array(
  15. 'serveronline' => '<b style="color: orange">Online</b>.',
  16. 'serveroffline' => '<b style="color: darkblue;">Offline</b>.',
  17. );
  18. $timeout = 1;
  19.  
  20. $server = array(
  21. 'check' => true,
  22. 'ip' => $ip,
  23. 'port' => $port,
  24. );
  25.  
  26. $output = "";
  27.  
  28. if ($server['check']) {
  29. if ($fp = @fsockopen($server['ip'], $server['port'], $errno, $errstr, $timeout)) {
  30. fclose($fp);
  31. $serveronline = true;
  32. $output .= "<p>\n";
  33. $output .= " ".$language['serveronline']."\n";
  34. $output .= "</p>\n";
  35. } else {
  36. $serveronline = false;
  37. $output .= "<p>\n";
  38. $output .= " ".$language['serveroffline']."\n";
  39. $output .= "</p>\n";
  40. }
  41. }
  42. switch($wynik['kategoria']){
  43. case("avp2"):( $kategoria2 = 'Alien vs. Predator 2'; ) break;
  44. case("bf2"):( $kategoria2 = 'Battlefield 2'; ) break;
  45. case("bf2142"):( $kategoria2 = 'Battlefield 2142'; ) break;
  46. case("bnc"):( $kategoria2 = 'BNC'; ) break;
  47. case("cod"):( $kategoria2 = 'Call of Duty'; ) break;
  48. case("cod2"):( $kategoria2 = 'Call of Duty 2'; ) break;
  49. case("cod4"):( $kategoria2 = 'Call of Duty 4'; ) break;
  50. case("coduo"):( $kategoria2 = 'Call of Duty: United Offensive'; ) break;
  51. case("cscz"):( $kategoria2 = 'Counter Strike: Condition Zero'; ) break;
  52. case("cs16"):( $kategoria2 = 'Counter-Strike 1.6'; ) break;
  53. case("css"):( $kategoria2 = 'Counter-Strike: Source'; ) break;
  54. case("dods"):( $kategoria2 = 'Day of Defeat: Source'; ) break;
  55. case("dmc"):( $kategoria2 = 'DeathMatch Classic'; ) break;
  56. case("dev"):( $kategoria2 = 'Devastation'; ) break;
  57. case("et"):( $kategoria2 = 'Enemy Territory'; ) break;
  58. case("etqw"):( $kategoria2 = 'ET: Quake Wars'; ) break;
  59. case("fear"):( $kategoria2 = 'F.E.A.R.'; ) break;
  60. case("hl2"):( $kategoria2 = 'Half-Life 2'; ) break;
  61. case("ja"):( $kategoria2 = 'Jedi Academy'; ) break;
  62. case("jk2"):( $kategoria2 = 'Jedi Knight 2'; ) break;
  63. case("mohaa"):( $kategoria2 = 'Medal of Honor : Allied Assault'; ) break;
  64. case("mohs"):( $kategoria2 = 'Medal of Honor: Spearhead'; ) break;
  65. case("prey"):( $kategoria2 = 'Prey'; ) break;
  66. case("qu"):( $kategoria2 = 'Quake'; ) break;
  67. case("qu2"):( $kategoria2 = 'Quake 2'; ) break;
  68. case("qu3"):( $kategoria2 = 'Quake 3 Arena'; ) break;
  69. case("qu4"):( $kategoria2 = 'Quake 4'; ) break;
  70. case("ro"):( $kategoria2 = 'Red Orchestra'; ) break;
  71. case("ship"):( $kategoria2 = 'Ship'; ) break;
  72. case("soldat"):( $kategoria2 = 'Soldat'; ) break;
  73. case("sof2"):( $kategoria2 = 'Soldier of Fortune 2'; ) break;
  74. case("toaot"):( $kategoria2 = 'Tactical Ops: Assault on Terror'; ) break;
  75. case("tf2"):( $kategoria2 = 'Team Fortress 2'; ) break;
  76. case("tfc"):( $kategoria2 = 'Team Fortress Classic'; ) break;
  77. case("teamspeak"):( $kategoria2 = 'Team Speak 2'; ) break;
  78. case("trem"):( $kategoria2 = 'Tremulous'; ) break;
  79. case("ut"):( $kategoria2 = 'Unreal Tournament'; ) break;
  80. case("ut2003"):( $kategoria2 = 'Unreal Tournament 2003'; ) break;
  81. case("ut2004"):( $kategoria2 = 'Unreal Tournament 2004'; ) break;
  82. case("ut3"):( $kategoria2 = 'Unreal Tournament 3'; ) break;
  83. case("urbant"):( $kategoria2 = 'Urban Terror'; ) break;
  84. case("warsow"):( $kategoria2 = 'Warsow'; ) break;
  85. default:( $kategoria2 = 'Brak!!!'; ) break;
  86. }
  87.  
  88.  
  89. echo'<table style="text-align: left; width: 390px; height: 172px;"
  90.  border="0" cellpadding="2" cellspacing="2">
  91. <tbody>
  92. <tr>
  93. <td style="font-weight: bold; text-align: right; width: 100px;"><big>Nazwa:</big></td>
  94. <td style="width: 661px; font-weight: bold;">'.$wynik[nazwa].'</td>
  95. </tr>
  96. <tr>
  97. <td style="font-weight: bold; text-align: right; width: 100px;"><big>Sloty:</big></td>
  98. <td style="width: 661px; font-weight: bold;">'.$wynik[sloty].'</td>
  99. </tr>
  100. <tr>
  101. <td style="font-weight: bold; text-align: right; width: 100px;"><big>Hasło:</big></td>
  102. <td style="width: 661px; font-weight: bold;">'.$wynik[haslo].'</td>
  103. </tr>
  104. <tr>
  105. <td style="font-weight: bold; text-align: right; width: 100px;"><big>Kategoria:</big></td>
  106. <td style="width: 661px; font-weight: bold;">'.echo $kategoria2.'</td>
  107. </tr>
  108. <tr>
  109. <td style="font-weight: bold; text-align: right; width: 100px;"><big>IP:PORT</big></td>
  110. <td style="width: 661px; font-weight: bold;">'.$wynik[ip].':'.$wynik[port].'</td>
  111. </tr>
  112. <tr>
  113. <td style="font-weight: bold; text-align: right; width: 100px;"><big>Dodano:</big></td>
  114. <td style="width: 661px; font-weight: bold;">'.$wynik[dnia].'</td>
  115. </tr>
  116. <tr>
  117. <td style="font-weight: bold; text-align: right; width: 100px;"><big>Status:</big></td>
  118. <td style="width: 661px; font-weight: bold;">'.$output.'</td>
  119. </tr>
  120. </tbody>
  121. </table>';
  122. }else{echo'Brak dostępu!<br>';}
  123. ?>

gdy go włacze wyskakuje mi
Kod
Parse error: syntax error, unexpected ';' in /home/feedback/public_html/page/serwery.php on line 41


Lnia 41:
  1. <?php
  2. 39: $output .= "</p>\n";
  3. 40: }
  4. 41: }
  5. 42: switch($wynik['kategoria']){
  6. 43: case("avp2"):( $kategoria2 = 'Alien vs. Predator 2'; ) break;
  7. ?>

O co chodzi??
prosze o szybka odp spieszy mi sie!
batman
Po co Ci tutaj ten nawias?
  1. <?php
  2. case("avp2"):( $kategoria2 = 'Alien vs. Predator 2'; ) break;
  3. ?>

Usuń go i będzie ok.

A na przyszłość.
Cytat
prosze o szybka odp spieszy mi sie!

Każdemu się spieszy i nieładnie jest poganiać innych. Jak ktoś będzie wiedział, to Ci odpowie.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.