File "print.php"
Full path: /home/kosmetik/public_html/api/bookurier/print.php
File
size: 1 B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
header("Content-Type: application/pdf");
function print_awb()
{
$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>" . $_REQUEST['awb_id'] . "</awb>\r\n\t\t </cmd>\r\n\t\t </msg>";
$msgstr = str_replace(array("\r", "\n", "\r\n", "\t"), '', $msgstr);
$user_id = $_REQUEST['username'];
$pwd = $_REQUEST['password'];
$fields = array('userid' => $user_id, 'pwd' => $pwd, 'msg' => urlencode($msgstr));
$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);
}
if ($_GET['awb_id'] != "" && $_GET['username'] != "" && $_GET['password'] != "") {
print_awb();
} else {
echo 'Eroare';
}