title: Post with Curl not working correctly
body: <p>I am using curl to do three tasks. That is, login to my test site, go to the form where  we input the text and get the hidden random <code>session_id</code>, set the third curl request to post the message with the session_id recieved.
  But here am able to perform only first two requests. The message is not posting.</p>
  
  <p>index.php
      
  
  <pre><code>$ch = curl_init();
  
  $url = 'http://webforum.com';
  
  include 'a.php';
  
  $url = 'http://webforum.com/add_message.php';
  
  include 'C.php';
  
  preg_match_all('|name="session_id" value="(.*?)"|',$store,$tks);
  
  $token = $tks[1][0];
  
  $postf = 'session_id='.$token.'&amp;add=mga&amp;text=TAPPOUT&amp;submit=Submit';
  
  include 'c.php';
  
  
  ?&gt;
  </code></pre>
  
  <p>c.php
      
  
  <pre><code>$cookie_file_path="cookies.txt";
  
  $agent="Nokia-Communicator-WWW-Browser/2.0 (Geos 3.0 Nokia-9000i)";
  
  $headers[]="Accept: */*";
  
  $headers[]="Connection: Keep-Alive";
  
  curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);
  
  curl_setopt($ch,CURLOPT_HEADER,0);
  curl_setopt($ch,CURLOPT_URL,$url);
  
  curl_setopt($ch,CURLOPT_COOKIEFILE,$cookie_file_path);
  
  curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
  
  curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
  
  curl_setopt($ch,CURLOPT_USERAGENT,$agent);
  
  curl_setopt($ch,CURLOPT_POST,1);
  
  curl_setopt($ch,CURLOPT_POSTFIELDS,$postf);
  
   curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  
  curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
  
   curl_setopt($ch,CURLOPT_COOKIEJAR,$cookie_file_path);
  
  $store = curl_exec($ch);
  
  ?&gt;
  </code></pre>
  
  <p>Can anyone figure out the problem?</p>