title: curl_init undefined?
body: <p>I am importing the contacts from gmail to my page .....</p>
  
  <p>The process does not  work due to this error </p>
  
  <blockquote>
    <p><code>'curl_init'</code> is not defined</p>
  </blockquote>
  
  <p>The suggestion i got is to </p>
  
  <ol>
  <li>uncomment destination curl.dll </li>
  <li>copy the following libraries to the windows/system32 dir: <code>ssleay32.dll</code> and <code>libeay32.dll</code></li>
  <li>copy php_curl.dll to windows/system32</li>
  </ol>
  
  <p>After trying all these, I refreshed my xampp, but even then error occurs.</p>
  
  <p>This is my page where I am trying to import the gmail contacts:</p>
  
  <pre><code>&lt;?php
  resource curl_init  ([  string $url = NULL  ] )
  
  $ch = curl_init();
  
  
  curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
  curl_setopt($ch, CURLOPT_HEADER, 0);
  
  
  curl_exec($ch);
  
  
  curl_close($ch);
  ?&gt;
  
  &lt;?php
  echo "hi";
  
  if($_POST['submit'] != '') {
      echo "hi";
  
      $clientlogin_url = "https://www.google.com/accounts/ClientLogin";
  
  
      $clientlogin_post = array(
      "accountType" =&gt; "HOSTED_OR_GOOGLE",
      "Email" =&gt; $_POST['Email'],
      echo "Passwd" =&gt; $_POST['Passwd'],
      "service" =&gt; "cp",
      "source" =&gt; "tutsmore/1.2"
      );
  
  
      $curl = curl_init($clientlogin_url);
  
  
      curl_setopt($curl, CURLOPT_POST, true);
  
  
      curl_setopt($curl, CURLOPT_POSTFIELDS, $clientlogin_post);
  
  
      curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
  
  
      curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  
  
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  
  
      $response = curl_exec($curl);
  
  
  
      preg_match("/Auth=([a-z0-9_\-]+)/i", $response, $matches);
      $auth = $matches[1];
  
  
      $headers = array("Authorization: GoogleLogin auth=" . $auth);
  
  
      $curl = curl_init('http://www.google.com/m8/feeds/contacts/default/full?max-results=10000');
  
  
      curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  
  
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  
  
      $feed = curl_exec($curl);
  
  
      echo "contacts".$contacts=array();
  
  
      $doc=new DOMDocument();
  
  
  
      if (!empty($feed)) $doc-&gt;loadHTML($feed);
  
  
      $xpath=new DOMXPath($doc);
  
  
      $query="//entry";
      $data=$xpath-&gt;query($query);
  
      foreach ($data as $node) {
  
  
          $entry_nodes=$node-&gt;childNodes;
  
  
          $tempArray=array();
  
  
          foreach($entry_nodes as $child) {
  
  
              $domNodesName=$child-&gt;nodeName;
  
              switch($domNodesName) {
                  case 'title' : { 
                          $tempArray['fullName']=$child-&gt;nodeValue;
                      } break
                      ;
                  case 'email' : {
                          if (strpos($child-&gt;getAttribute('rel'),'home')!==false)
                              $tempArray['email_1']=$child-&gt;getAttribute('address');
                          elseif(strpos($child-&gt;getAttribute('rel'),'work')!=false)
                              $tempArray['email_2']=$child-&gt;getAttribute('address');
                          elseif(strpos($child-&gt;getAttribute('rel'),'other')!==false)
                              $tempArray['email_3']=$child-&gt;getAttribute('address');
                      } break
                      ;
              }
          }
          if (!empty($tempArray['email_1']))$contacts[$tempArray['email_1']]=$tempArray;
          if(!empty($tempArray['email_2'])) $contacts[$tempArray['email_2']]=$tempArray;
          if(!empty($tempArray['email_3'])) $contacts[$tempArray['email_3']]=$tempArray;
      }
      foreach($contacts as $key=&gt;$val) {
  
          echo $key."&lt;br/&gt;";
      }
  }
  else {
  
      ?&gt;
  &lt;form action="&lt;?=$PHP_SELF?&gt;" method="POST"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;Email:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="Email" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Password:&lt;/td&gt;&lt;td&gt;&lt;input type="password" name="Passwd" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;&lt;td colspan="2" align="center"&gt;tutsmore don't save your email and password trust us.&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td colspan="2" align="center"&gt;&lt;input type="submit" name="submit" value="Get Contacts" /&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
      &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>This code is completely provided for debugging; if any optimization is needed, I will try to optimize the code.</p>