PHP curl post request with parameters
<p>I am trying to create a new user subscription using curl, but it seems the parameters never gets sent:</p>

<pre><code>$url = 'http://www.domain.com/user_sub/new';

$curl = curl_init($url);

$curl_post_data = array(
    'email' =&gt; 'user_email@example.com',
    'f_name' =&gt; 'John',
    'l_name' =&gt; 'Doe',
    'zip_code' =&gt; 'GB211',
    'promo' =&gt; 'promocode'
);

curl_setopt($curl, CURLOPT_POST, true);

curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($curl_post_data));

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);    

$curl_response = curl_exec($curl);

curl_close($curl);
</code></pre>

<p>...</p>

<p>If I do a straight url post over browser it works e.g:</p>

<pre><code>http://www.domain.com/user_sub/new?email=user_email@example.com&amp;f_name=John&amp;l_name=Doe&amp;zip_code=GB211&amp;promo=promocode
</code></pre>

<p>What am I doing wrong please?</p>