This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 5th, 2013  |  syntax: PHP  |  size: 1.17 KB  |  views: 40  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. global $stores;
  2.            
  3.             $xmlStores = new SimpleXMLElement($stores);
  4.            
  5.             foreach($xmlStores as $store) {
  6.  
  7.                     if ($store->id == STORE_ID){
  8.                         $storeWebAddress = $store->webaddress."/volantews/api";
  9.                         $storeWebAddressPort = $store->port;
  10.                     }
  11.                    
  12.             }
  13.    
  14.             $ch = curl_init($storeWebAddress);
  15.             curl_setopt( $ch, CURLOPT_POST, 1 );
  16.             //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  17.             //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  18.             curl_setopt( $ch, CURLOPT_POSTFIELDS, $xmlRequest );
  19.             curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
  20.             curl_setopt( $ch, CURLOPT_TIMEOUT, 240 );
  21.             curl_setopt($ch, CURLOPT_PORT, $storeWebAddressPort);
  22.             $xmlResponse = curl_exec( $ch );            
  23.             curl_close($ch);
  24.            
  25.            
  26.             if($xmlResponse) {
  27.                 return $xmlResponse;
  28.             }
  29.             else{
  30.                 $conf['type'] = "Content-Type:text/html";
  31.                 return "err";
  32.             }
clone this paste RAW Paste Data