title: PHP Forwarding JSON Object
body: <p>For security reasons I have to forward a JSON Object from a Jquery Script to a PHP Script. Here is what I have done yet:</p>
  
  <pre><code>&lt;?php
  header('Access-Control-Allow-Origin: *');
  
  $input = @file_get_contents('php://input');
  $content = json_encode( $input );
  
  $url = $_GET["trakt_url"]."KEY";
  
  $ch = curl_init($url);                                                                 
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
  curl_setopt($ch, CURLOPT_POSTFIELDS, $content);                                                                  
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
  curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
      'Content-Type: application/json')                                                                       
  );                                                                                                                   
  
  $result = curl_exec($ch);
  echo $result;
  ?&gt;
  </code></pre>
  
  <p>If I log the $content I get the JSON Object but the page($url) at where I post to is getting an empty Object. Does someone have an idea what I am doing wrong?</p>
  
  <p><strong>Solved</strong> (someone answered correctly but the answer is deleted?!)</p>
  
  <p><strong>curl_setopt($ch, CURLOPT_POSTFIELDS, "json=$content");</strong></p>