Advertisement
Guest User

Untitled

a guest
Aug 15th, 2012
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.58 KB | None | 0 0
  1. <?php
  2.     // this first line is so that i can test the php file from a web interface. I was going to remove it when done.
  3.     if($_GET!=array())$_POST=$_GET;
  4.     if ($_POST['auth'] == "3fc52c779e781294") {echo("Connected.");} else {exit("Bukkit to PHP Password Incorrect.");}
  5.    
  6.     // these are here to print the $_POST array. The first is the one i was using before you told me about print_r
  7.     // echo(" POST: ");foreach($_POST as $key => $val)echo("[".$key."=".$val."]");echo(" ");
  8.     echo(print_r($_POST));
  9.    
  10.     // ignore this
  11.     if ($_POST['test']){exit("test");}
  12.    
  13.     include_once("PHPsend.php");
  14.     $php = new PHPsend();
  15.    
  16.     // this is here because i wanted to include several time functions.
  17.     date_default_timezone_set("GMT");
  18.    
  19.     // this is the part that's having trouble. The ip, password, and port are correct.
  20.     if ($_POST['ping']){
  21.         echo("Status: ");
  22.         // i have tried the port field with both 11223 and 25565, and none at all. i suggest you make this clearer in your documentation.
  23.         echo($php->PHPconnect("86.4.163.232","3fc52c779e781294","11223"));
  24.         // please do not try to connect to my server using this file.
  25.        
  26.         // ignore this
  27.         // $php->PHPcommand("runalias /run /php ping ".time());
  28.        
  29.         echo($php->PHPcommand("runalias /run /broadcast WORKING"));
  30.         echo($php->PHPdisconnect());
  31.        
  32.         // these php commands always result in an error code of 211, meaning the password was wrong, and the other naturally gave errors as there was no connection.
  33.     }
  34. exit(1);?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement