When there is data by method post
, the data will always exist Pending
and if there is no data by method post
, it must allow the data to pass by method get
, therefore, if the data exists in the url cancel
or if it does not exist, it will still pass a message by default Procees
.
if (empty($_POST['payment_status'])) || if (empty($_GET['payment_status'])) $_GET['payment_status'] = 'Procees';
switch ($_POST['payment_status'] OR $_GET['payment_status'])) {
case 'cancel':
# code...
break;
case 'Procees':
# code...
break;
case 'Pending':
# code...
break;
}
But it doesn't work for me, it prints the following error message:
Parse error: syntax error, unexpected '||' (T_BOOLEAN_OR) in C:\xampp\htdocs\cart\dataget.php on line 9
I already tried using &&, ||, OR
but it shows me the same error message