title: Php Curl return 200 but not posting
body: <p>I'm sorry to disturb you but I can't figure out what is the error on my code. I'm trying to Make a HTTP Post Request on the following , my response code is 200 but It doesn't work. 
  Below is my code. If anyone can help I would appreciate his effort very much.</p>
  
  <pre><code>    &lt;?php
  
  //create array of data to be posted
  
  $post_data['data[title]'] = 'TITLE';
  $post_data['data[category_id]'] = 'Register';
  $post_data['data[private_business]'] = 'private';
  $post_data['data[description]'] = 'Description for anyone';
  $post_data['data[param_size]'] = '1129';
  $post_data['data[param_price][currency]'] = 'RON';
  //$post_data['data[param_price][0]'] = 'price';
  $post_data['data[param_price][1]'] = '100';
  //$post_data['data[param_price][2]'] = '';
  $post_data['data[param_state]'] = 'used';
  $post_data['data[city]'] = '26711';
  $post_data['data[person]'] = 'Ion';
  $post_data['data[email]'] = 'email';
  $post_data['data[accept]'] = 'on';
  
  
  //traverse array and prepare data for posting (key1=value1)
  foreach ( $post_data as $key =&gt; $value) {
      $post_items[] = $key . '=' . $value;
  }
  
  //create the final string to be posted using implode()
  $post_string = implode ('&amp;', $post_items);
  
  //create cURL connection
  $curl_connection =
    curl_init('http://olx.ro/i2/adauga-anunt/');
  
  //set options
  curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
  curl_setopt($curl_connection, CURLOPT_USERAGENT,
    "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.17 Safari/537.36");
  curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($curl_connection, CURLOPT_HEADER, 0);
  curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
  
  $headers = array();
  
  //$headers[] = 'Host: olx.ro';
  //$headers[] = 'User-Agent:"Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:35.0) Gecko/20100101 Firefox/35.0';
  //$headers[] = 'Accept: */* ';
  //$headers[] = 'Accept-Language: en-US,en;q=0.5';
  //$headers[] = 'Accept-Encoding: gzip, deflate';
  //$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
  //$headers[] = 'X-Requested-With: XMLHttpRequest';
  //$headers[] = 'Referer: http://olx.ro/i2/adauga-anunt/';
  //$headers[] = 'Content-Length: 594';
  //$headers[] = 'Cookie: PHPSESSID=otsg9lalsh5m06faaviuqtmih4; xtvrn=$542850$540516$; optimizelySegments=%7B%221067457090%22%3A%22ff%22%2C%221087063106%22%3A%22none%22%2C%221060248541%22%3A%22direct%22%2C%221042136847%22%3A%22false%22%2C%221092431561%22%3A%22none%22%2C%221079661599%22%3A%22ff%22%2C%221027596252%22%3A%22false%22%2C%221069071887%22%3A%22direct%22%7D; optimizelyEndUserId=oeu1425804897718r0.9477511105813824; optimizelyBuckets=%7B%7D; POPUPCHECK=1425891298025; is_tablet=0; __utma=29471969.1470095060.1425804898.1425804898.1425804898.1; __utmb=29471969.61.10.1425804898; __utmc=29471969; __utmz=29471969.1425804898.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); last_used_locations=%5B%7B%22regionId%22%3A%224%22%2C%22cityId%22%3A%2226711%22%2C%22districtId%22%3Anull%2C%22label%22%3A%22Brasov%22%2C%22details%22%3A%22Brasov%22%2C%22source%22%3A%22adding%22%2C%22precision%22%3A%22precision-adding%22%7D%5D; mobile2=desktop; ki_t=1425808476633%3B1425808476633%3B1425808476633%3B1%3B1; ki_r=';
  //$headers[] = 'Connection: keep-alive';
  //$headers[] = 'Pragma: no-cache';
  //$headers[] = 'Cache-Control: no-cache';
  
  
  //curl_setopt($curl_connection, CURLOPT_HTTPHEADER, $headers);
  
  
  
  //set data to be posted
  curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
  
  //perform our request
  $result = curl_exec($curl_connection);
  
  //show information regarding the request
  print_r(curl_getinfo($curl_connection));
  echo curl_errno($curl_connection) . '-' .
                  curl_error($curl_connection);
  
  if(curl_errno($c))
  {
      echo 'error:' . curl_error($curl_connection);
  }
  
  //close the connection
  curl_close($curl_connection);
   return $result;
  ?&gt;
  </code></pre>
  
  <p>The curl informations about errors that I receive are on the following code.</p>
  
  <blockquote>
    <p>Array ( [url] => <a href="http://olx.ro/i2/adauga-anunt/" rel="nofollow">http://olx.ro/i2/adauga-anunt/</a> [content_type] =>
    text/html; charset=UTF-8 [http_code] => 200 [header_size] => 418
    [request_size] => 556 [filetime] => -1 [ssl_verify_result] => 0
    [redirect_count] => 0 [total_time] => 0.35955 [namelookup_time] =>
    0.009494 [connect_time] => 0.160634 [pretransfer_time] => 0.160793 [size_upload] => 302 [size_download] => 0 [speed_download] => 0
    [speed_upload] => 839 [download_content_length] => 0
    [upload_content_length] => 302 [starttransfer_time] => 0.359489
    [redirect_time] => 0 [certinfo] => Array ( ) [primary_ip] =>
    178.21.159.40 [primary_port] => 80 [local_ip] => 172.17.64.2 [local_port] => 36961 [redirect_url] => ) 0-</p>
  </blockquote>
  
  <p>Thank you very much for your help!!</p>