title: Simple cURL doesn't work
body: <p>I want to use cURL to automatically post a form.
  This is the form I want to post with cURL:</p>
  
  <pre><code>&lt;form action="login/main_login.php" method="post"&gt;
  &lt;input type="hidden" name="url" value="index.php" /&gt;
  &lt;input type="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I use this code:</p>
  
  <pre><code>$ch =curl_init();
  curl_setopt($ch, CURLOPT_URL, 'login/main_login.php');
  curl_setopt($ch, CURLOPT_POST, TRUE);
  curl_setopt($ch, CURLOPT_POSTFIELDS, "url=index.php");
  $data = curl_exec($ch);
  curl_close($ch);
  </code></pre>
  
  <p>But it isn't working, it is not even sending me to the login/main_login.php.
  I am using wampserver and edited both php.ini files by uncomment extension=php_curl.dll .</p>
  
  <p>Using echo curl_error();
  gives me the following error:</p>
  
  <pre><code>curl_error() expects exactly 1 parameter, 0 given inWarning: curl_error() expects exactly 1 parameter, 0 given in C:\wamp\www\website\page.php on line 10
  </code></pre>
  
  <p>Putting </p>
  
  <pre><code>if($data==FALSE)
  {
      die("Curl failed: " . curL_error($ch));
  }
  </code></pre>
  
  <p>in front of curl_close($ch); gives me a blank page with the text:</p>
  
  <blockquote>
    <p>Curl failed: Could not resolve host: login; Host not found</p>
  </blockquote>