Copyright (C) 2009 David Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> $fair['username'], 'password' => $fair['password']); $str = json_encode(array_merge($d, $data)); break; case 'ysc': if($ysc_url == '') $url = $fair['url']; else $url = $ysc_url; $var = 'xml'; $output=""; xmlCreateRecurse($data); $str = $output; break; } // echo "
Curl Send: $str
"; $ch = curl_init(); /// initialize a cURL session curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_HEADER, 0); /// Header control curl_setopt ($ch, CURLOPT_POST, 1); /// tell it to make a POST, not a GET curl_setopt ($ch, CURLOPT_POSTFIELDS, "$var=".urlencode($str)); /// put the query string here starting with "?" curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); /// This allows the output to be set into a variable $datastream curl_setopt ($ch, CURLOPT_POSTFIELDSIZE, 0); curl_setopt ($ch, CURLOPT_TIMEOUT, 360); curl_setopt ($ch, CURLOPT_SSLVERSION, 3); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false); $datastream = curl_exec ($ch); /// execute the curl session and return the output to a variable $datastream curl_close ($ch); /// close the curl session // echo "
Server Returned: ".urldecode($datastream)."
"; switch($fair['type']) { case 'sfiab': $ret=json_decode(urldecode($datastream), true); break; case 'ysc': $datastream = str_replace(" standalone=\"yes\"","",$datastream); /* Return is plaintext, make a return array */ $ret['error'] = 0; $ret['message'] = $datastream; break; } // echo "
Server Returned: ";print_r($ret);echo "

"; return $ret; } ?>