$.ajax({
url: '/ajax',
data: 'action=transaction',
type: 'POST'
});
$_SESSION['paymentstatus'] = '1';
$action = filter_input(INPUT_POST,'action');
$res = '';
switch ($action) {
case 'transaction':
$_SESSION['paymentstatus'] = '1';
$res = '1';
break;
if (!empty($res)) {
die($res);
}
action=transaction
, а в php case 'transactionId':
.filter_input
, если можно просто использовать $_POST['action']
?if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest') {return;}