title: AJAX Response Text Empty
body: <p>I'm creating a system that interacts with Minecraft server using AJAX. My JavaScript code is as follows:</p>
  
  <pre><code>function doMessage(name, message)
      {
          var xmlhttp;
  if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
  else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  xmlhttp.open("GET","http://duncan.usr.sh/omnicraft/api/broadcast-msg.php?message=" + message + "&amp;user=" + name,false);
  xmlhttp.send();
  document.getElementById("response").innerHTML=xmlhttp.responseText;
  }
  </code></pre>
  
  <p>My PHP code is as follows:</p>
  
  <pre><code>&lt;?php
  header('content-type: text/plain');
  
  echo "OmniCraft/Api/RequestHTTP";
  
  if($_GET['message'] == "" or ctype_space($_GET['message']) or $_GET['user'] == "" or ctype_space($_GET['user']))
  {
  
      echo "\nOmniCraft/Api/Request/Failed";
      echo "\nRequest invalid: No message specified";
      exit;
  }
  
  include_once '../MinecraftQuery.class.php';
  
      $Query = new MinecraftQuery( );
  
      try
      {
          $Query-&gt;Connect( 'localhost', 25565 );
  
      $info = $Query-&gt;GetInfo( );
  
  
  
  
  
      }
      catch( MinecraftQueryException $e )
      {
          echo "\nOmniCraft/Api/Request/Failed";
      echo "\nServer not online";
      exit;
      }
  
  include_once("rcon.class.php"); //Include this file
  $r = new rcon("127.0.0.1",25575,"notRealPasswordHere"); //create rcon object for server on the rcon port with a specific password
  if($r-&gt;Auth()) //Connect and attempt to authenticate
  {
  $message = $_GET['message'];
  $user = $_GET['user'];
  $r-&gt;rconCommand("/tellraw @a {'text':'&lt;$user using OmniMessage&gt; $message','color':'white'}"); //send a command
  echo "\nOmniCraft/Api/Request/Success";
  echo "\nMessage sent successfully!";
  }
  else
  {
  echo "\nOmniCraft/Api/Request/Failed";
  echo "\nUnable to authenticate to RCON";
  exit;
  }
  
  ?&gt;
  </code></pre>
  
  <p>My form is as follows:</p>
  
  <pre><code>&lt;form &gt;
      &lt;div class="input"&gt;
      &lt;input type="text" placeholder="Message" style="padding: 20px 28px;font-size: 25px;" required="true" name="message"&gt;
      &lt;/div&gt;
      &lt;div class="input"&gt;
      &lt;input type="text" placeholder="Name" style="padding: 20px 28px;font-size: 25px;" required="true" name="name"&gt;
      &lt;/div&gt;
  
      &lt;button class="btn btn-large btn-success" type="button" onclick="doMessage(this.form.name.value, this.form.message.value)"&gt;Send&lt;/button&gt;
      &lt;div&gt;
      &lt;p class="lead" id="preview"&gt;&amp;lt; using OmniMessage&amp;gt;&lt;/p&gt;
      &lt;div&gt;
      &lt;div id="response"&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>The AJAX query executes well, except for the fact that the responseText variable seems to not contain the response text (i.e. the DIV with the id 'response' remains empty after the query is complete).</p>
  
  <p>The correct contents of the response DIV should be:</p>
  
  <pre><code>OmniCraft/Api/RequestHTTP
  OmniCraft/Api/Request/Success
  Message sent successfully!
  </code></pre>
  
  <p>However, this is not the case. What am I doing wrong?</p>
  
  <p>EDIT: More Info:</p>
  
  <p>I get the following error:</p>
  
  <p>[20:14:21.855] NS_ERROR_FAILURE: Failure @ <a href="http://omnicraft.duncan.usr.sh/omnimessage/:154" rel="nofollow">http://omnicraft.duncan.usr.sh/omnimessage/:154</a></p>
  
  <p>Line 154 is: <code>xmlhttp.send();</code>
  (or maybe <code>document.getElementById("response").innerHTML=xmlhttp.responseText;</code></p>