<?php
header('Content-Type: application/json');
$postData = file_get_contents('php://input');
$data = json_decode($postData, true);
$file = 'order.txt';
$current = file_get_contents($file);
$current = $postData;
file_put_contents($file, $current);
echo json_encode(
array(
'status' => '1',
'message' => 'Error'
);
$.ajax({
type: "POST",
url: 'url',
data:data,
dataType: 'jsonp',
error: function(request,error) {
console.log(request);
console.log(error);
},
success: function(data) {
console.log(data);
}
});
echo json_encode(
array(
'status' => 1,
'message' => 'Error'
)
);
Для физ лица:
Для юр лица: