title: JSON object to php variables
body: <p>I need to convert a JSON object that the php receive from the html form into php variable. I have two forms form1 gives the values and form2 submits them. this is where I give form2 the JSON string value</p>
  
  <pre><code>-html--javascript function-
  
  var myObj = {
      "username" : theUsername,
      "name" : theName,
      "surname" : theSurName,
      "email" : theEmail,
      "password" : thePass,
      "confirmpass" : thePass2,
      "dob" : theDate,
      "gender" : theGender,
      "age" : theAge
  };
  
  var jsonstr=JSON.stringify(myObj);
  document.forms["form2"]["hide"].value = jsonstr; //form2 gets the whole string
  </code></pre>
  
  <p>-php-
  //$jstr = $_REQUEST["hide"];</p>
  
  <p>//$newObj=JSON.parse(jstr);</p>
  
  <p>//$name = $newObj.name;</p>
  
  <p>This is what I tried, but it doesn't work</p>
  
  <p>I used the post method in the html.
  How do I now convert it back into seperate variables in php ?</p>