title: php 'curl' not working
body: <p><br />
  I'm trying to send some value from  '1.php' page to '3.php' page by using 'curl'.
  <br /><br /> Heres my code- <br /></p>
  
  <p><strong>1.php</strong></p>
  
  <pre><code>&lt;?php
  $data = array();
  $data['first_name'] = 'hello';
  $data['last_name'] = 'Thind';
  $data['password'] = 'secret';
  $data['email'] = 'me@abc.com';
  $post_str =''; 
  foreach($data as $key=&gt;$val)
  { $post_str .= $key.'='.$val.'&amp;'; } 
  $post_str = substr($post_str, 0, -1);
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, '3.php' );
  curl_setopt($ch, CURLOPT_POST, TRUE); 
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post_str);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  $result = curl_exec($ch);
  curl_close($ch);
  echo $result;
  ?&gt;
  </code></pre>
  
  <p><strong>3.php</strong></p>
  
  <pre><code>&lt;?php
  $host="localhost";       
  $dbname="mr"; 
  // mysql code for table= create table m(name varchar(10));
  $username="";            
  $password="";
  $con=mysql_connect("$host","$username","$password")or die("cannot connect");
  mysql_select_db($dbname) or DIE('cannot select db');
  if(isset($_POST['first_name'])){
  $name=$_POST['first_name'];
  $sql="insert into m
  values('$name')";
  $sq=mysql_query($sql);
  echo"ok";
  }
  mysql_close($con);
  ?&gt;
  </code></pre>
  
  <p>My problem is <strong>"No data is inserted into database cause no data is transfered to 3.php from 1.php"</strong> .I checked database code in '3.php' by giving some value and that was inserted correctly into database.So code in '3.php' works well.So it seems the code in '1.php' not working. 
  <br /> (<strong><em>Note:</em></strong> php_curl.dll is activated in php.ini file. I'm using windows xp professional service pack-2, xampp-win32 version-1.8.1)
  <br /><br /> Can anybody please tell me whats wrong there ?</p>
  
  <p>-Thanks.</p>