Hello Everyone!
I cannot figure out why this code works locally on my PC (localhost) but not online on a public server? Can it be a PHP version issue? Thankful for all help!
$post_data = array('item_type_id' => '8', 'string_key' => 'Test Nyckel2', 'string_value' => 'Test Varde2', 'string_extra' => 'Test Extra', 'numeric_extra' => 'Test Numeric Extra', 'is_public' => true, 'is_public_for_contacts' => true);
$post_data = json_encode(array('item' => $post_data), JSON_FORCE_OBJECT);
$c = curl_init('http://example.com/items.json');
curl_setopt($c, CURLOPT_VERBOSE, 1);
curl_setopt($c, CURLOPT_COOKIE, 'fb_cookie='.$fb_code);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $post_data);
curl_exec($c);
curl_close($c);