title: Passing Json using Ajax Post via javascript to php not working
body: <p>Hi i am trying to send Json via Ajax to PHP using Javascript. The data is sent correctly by index.html when I view it on firebug. It shows Json type with the correct data. 
  However, it seems that I am unable to read the JSON on php. I am unable to access it using $_POST. 
  I tried using $_POST['name'] and there is not response.
  When i try using $_POST, the response is array.
  Can you please help me?</p>
  
  <p>Here is my javascript code.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
      //Create Http request depending on browser
      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.onreadystatechange=function(){
        if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200){
          document.getElementById("myDiv").innerHTML=xmlhttp.responseText;}
        }
  
      // Function to create 
      var url = "control.php";
      xmlhttp.open("POST",url,true);
      xmlhttp.setRequestHeader("Content-Type", "application/json; charset=utf-8");
      var data=JSON.stringify({"name":"John", "time":"2pm"});
      xmlhttp.send(data);
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h2&gt;AJAX&lt;/h2&gt;
  &lt;button type="button" onclick="loadXMLDoc()"&gt;Request data&lt;/button&gt;
  &lt;div id="myDiv"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my php code</p>
  
  <pre><code>&lt;?php
  include_once('JSON.php');   
  $json = new Services_JSON();
  $value = $json-&gt;decode($_POST['name']);
  echo $value;
  ?&gt;
  </code></pre>
  
  <p>Have been working on this for days and I really appreciate any help that you can offer.
  Thank you!</p>