Проверка тикет

// Initiate curl
//$url=’http://217.16.85.102:8280/bet-terminal-ws/async/getTicket/3101176/3717.json’;
if(isset($_POST[‘submit’]))
{
$serial=$_POST[‘serial’];
$pin=$_POST[‘pin’];
$url=’http://217.16.85.102:83/bet-terminal-ws/async/getTicket/’.$serial.’/’.$pin.’.json’;
$ch = curl_init();
// Disable SSL verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL,$url);
// Execute
$result=curl_exec($ch);
// Closing
curl_close($ch);

// Will dump a beauty json :3
header(‘Content-Type: text/html; charset=utf-8’);

$result=json_decode($result, true);
$printedForm= $result[‘ticket’][‘printedForm’];
$printedForm=str_replace(” “, ” “, $printedForm);
$printedForm=str_replace(“\n”, ”
“, $printedForm);
//var_dump($result);
if($printedForm!=””){
echo ”

Статусот на тикетот е : “.$result[‘ticket’][‘processResult’][‘pstatus’].”
“;
echo $printedForm.””;}
else
{
echo ”

Серискиот број или пин кодот е невалиден.
“;
}
}

//var_dump(json_decode($result, true));

// // create a new cURL resource
// $ch = curl_init();
//
// // set URL and other appropriate options
// curl_setopt($ch, CURLOPT_URL, ‘http://bet.dualsoft.net:8280/bet-terminal-ws/async/getTicket/18003/193BAA32/6033.json’);
// curl_setopt($ch, CURLOPT_HEADER, 0);
//
// // grab URL and pass it to the browser
// echo $ch;
// //$pom=curl_exec($ch);
//
// // close cURL resource, and free up system resources
// curl_close($ch);

?>

 

 

 

 

 

ПИН: