File "sterge_awb.php"
Full path: /home/kosmetik/public_html/api/fan_courier/sterge_awb.php
File
size: 953 B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
header('Content-type:application/json');
function sterge_awb()
{
$params = array('username' => $_REQUEST['username'], 'user_pass' => $_REQUEST['password'], 'client_id' => $_REQUEST['id_client'], 'AWB' => $_REQUEST['awb_id']);
$data = json_encode($params);
$url = 'https://www.selfawb.ro/delete_awb_integrat.php';
$c = curl_init($url);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
$run = curl_exec($c);
curl_close($c);
return $run;
}
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_SERVER["CONTENT_TYPE"] == "application/json") {
$data = trim(file_get_contents("php://input"));
$json = json_decode($data, true);
if (is_array($json)) {
$_REQUEST = $json + $_REQUEST;
}
echo sterge_awb();
} else {
http_response_code(405);
}