Public paste
sbug
By: me | Date: Feb 11 2010 21:01 | Format: PHP | Expires: never | Size: 3.06 KB | Hits: 1041

  1. <?php
  2. if(!isset($_SESSION["UserID"]) || strlen($_SESSION["UserID"])<1){
  3. echo '<script>alert("Sessione terminata , devi riloggarti.");location.href="../default.php";</script>';
  4. }
  5. $conn = mysql_connect('188.165.193.155', 'root', '');
  6.  
  7. ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  8. <HTML><HEAD><TITLE></TITLE>
  9. <META http-equiv=Content-Type content="text/html; charset=gb2312">
  10. <STYLE type=text/css>
  11. body {
  12.         margin-left: 0px;
  13.         margin-top: 0px;
  14.         margin-right: 0px;
  15.         margin-bottom: 0px;
  16.         background-color: black;
  17.         background-image: url(http://forum.empiremt2.eu/site_logo.JPG);
  18.         background-repeat: repeat;
  19. }
  20. a:link {
  21.         color: #333333;
  22.         text-decoration: none;
  23. }
  24. a:visited {
  25.         text-decoration: none;
  26.         color: #333333;
  27. }
  28. a:hover {
  29.         text-decoration: underline;
  30.         color: #FF0000;
  31. }
  32. a:active {
  33.         text-decoration: none;
  34.         color: #FF0000;
  35. }
  36. .style1 {font-size: 12px}
  37. </STYLE>
  38. <center><img href=""><br><br>
  39. <?
  40. if (!mysql_select_db('account2', $conn)) {
  41.     echo 'Impossibile connettersi al database ...';
  42.     exit;
  43. }
  44. mysql_query ("SET NAMES 'utf8'",$conn);
  45. mysql_set_charset ('utf8',$conn);
  46. $queryz = "SELECT id FROM account WHERE login='".$_SESSION['UserID']."'";
  47. $res = mysql_query ($queryz,$conn);
  48.  
  49. while ($r = mysql_fetch_array($res, MYSQL_ASSOC)) {
  50.         $pg1 = IDtoNAME ($r["id"],$conn,0);
  51.         $pg2 = IDtoNAME ($r["id"],$conn,1);
  52.         $pg3 = IDtoNAME ($r["id"],$conn,2);
  53.         $pg4 = IDtoNAME ($r["id"],$conn,3);
  54.         $pg5 = IDtoNAME ($r["id"],$conn,4);
  55. }
  56.  
  57. Function IDtoNAME ($id,$conn,$i) {
  58. Global $row1;
  59. if (!mysql_select_db('player3', $conn)) {
  60.     echo 'Impossibile connettersi al database ...';
  61.     exit;
  62. }
  63.  
  64. $result = mysql_query("SELECT name FROM player WHERE account_id='".$id."' LIMIT ".$i.",1",$conn);
  65. while ($row1 = mysql_fetch_row($result))
  66. return $row1[0];
  67. }
  68. echo "<table border='1' width='600' height='200'><tr><td>";
  69. echo "<form action='#' name='asd' method='post'>";
  70. echo "<center><select name='pg'>";
  71. echo "<option value='".$pg1."' selected='selected'>".$pg1."</option>";
  72. echo "<option value='".$pg2."'>".$pg2."</option>";
  73. echo "<option value='".$pg3."'>".$pg3."</option>";
  74. echo "<option value='".$pg4."'>".$pg4."</option>";
  75. echo "<option value='".$pg5."'>".$pg5."</option>";
  76. echo "<input type='submit' value='Sbugga!'>";
  77. echo "</select></center>";
  78. echo "</forum>";
  79. echo "</td></tr></table>";
  80. if (isset($_POST['pg'])){
  81. $sbug = mysql_query ("UPDATE player SET x='237881', y='551031' , exit_x='237881' , exit_y='551031' , map_index='63 , exit_map_index='63' WHERE name='".$_POST['pg']."'");
  82. if (!$sbug) {
  83. echo "<br><center><b>Errore , impossibile eseguire la query!</b></center>";
  84. } else {
  85. echo "<br><center><b>Il tuo pg è stato sbuggato e teleportato in un punto del deserto , aspetta 15 minuti prima di loggare!</b>";
  86. echo "<b>Ora sono le ".date ("H:i:s")." , quindi ti consigliamo di loggare non prima delle ".date ("H:i:s", mktime(date("i")+15));
  87. echo "<br><b>Ti ricordiamo inoltre che nel caso avessi sbuggato il tuo pg e subito ci fosse subito dopo un riavvio , puoi anche non aspettare i 15 minuti.</b></center>";
  88. }
  89. ?>