File "call_courier.php"
Full path: /home/kosmetik/public_html/api/bookurier/call_courier.php
File
size: 696 B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
$url = 'http://www.bookurier.ro/colete/serv/get_AWB_pdf.php';
$ch = curl_init();
$msgstr = "<msg>\r\n\t\t\t<cmd>\r\n\t\t\t<awb>000683206200</awb>\r\n\t\t </cmd>\r\n\t\t </msg>";
$msgstr = str_replace(array("\r", "\n", "\r\n", "\t"), '', $msgstr);
$user_id = "apitest";
$pwd = "testapi";
$fields = array('userid' => $user_id, 'pwd' => $pwd);
$fields_string = '';
foreach ($fields as $key => $value) {
$fields_string .= $key . '=' . $value . '&';
}
rtrim($fields_string, '&');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec($ch);