If there is data returned or received by method $ _POST, it will have the value process
if there are no returned or received values, it will have the value cancel
The code states it in the following way, but there is a fatal error:
Fatal error: Using $ this when not in object context in C: \ xampp \ htdocs \ PayPal \ success.php on line 48
Line 48 of the error refers to the following line of code else $this->action = 'cancel';
How can I fix this error, or how to create in $_POST
a true
& false
to get the operation of the following code:?
if(!empty($_POST)) $this->action = 'process';
else $this->action = 'cancel';
switch($this->action){
case 'process':
# code...
echo "process";
break;
case 'cancel':
# code...
echo "cancel";
break;
}