title: How to call action using CURL in magento?
body: <p>I have to call action using CURL, because of backround process. Below is my code.</p>
  
  <pre><code>$url = "http://www.domain.com/index.php/checkout/cart/deleteall";  
  
  $ch = curl_init();
  curl_setopt($ch,CURLOPT_URL,$url);
  curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  $data = curl_exec($ch);
  $errorMsg = curl_error($ch);
  curl_close($ch);
  echo $data;
  echo '&lt;br/&gt;';
  echo $errorMsg;
  die();
  </code></pre>
  
  <p>Cart Controller action</p>
  
  <pre><code>public function deleteallAction()
      {
          $cartHelper = Mage::helper('checkout/cart');
          $items = $cartHelper-&gt;getCart()-&gt;getItems();       
          foreach ($items as $item){
              $itemId = $item-&gt;getItemId();
              $cartHelper-&gt;getCart()-&gt;removeItem($itemId)-&gt;save();
          }
          $this-&gt;_redirectReferer(Mage::getUrl('*/*'));
      }
  </code></pre>
  
  <p>I have create deleteallAction in cart controller. But CURL its not working. Its also not give me any error. I have call this in ajax. </p>
  
  <p>Please guide me, if I am wrong.</p>
  
  <p>Thank you!</p>