How can I request the orderAction () method on the Controller page using the $ post () method in phpMVC? in php MVC, how can I request the orderAction () method on the Controller page using the $ post () method?
// This is the request address I wrote.
$ OrderUrl = 'HTTP: // '. $ _ SERVER ['HTTP _ host'].'/Ehking/Controller/OnlinePayController. php/order ';
$. Post (
\ ''. $ OrderUrl .'\',
{
MerchantId: \ ''. $ merchantId .'\',
Policyurl: \ ''. $ policyurl .'\',
CallbackUrl: \ ''. $ callbackUrl .'\',
RequestId: \ ''. $ requestId .'\',
OrderAmount: \ ''. $ orderAmount .'\',
OrderCurrency: \ ''. $ orderCurrency .'\',
PaymentModeCode: \ ''. $ paymentModeCode .'\',
Remark: \ ''. $ remark .'\',
MerchantUserId: \ ''. $ merchantUserId .'\',
PayerName: \ ''. $ payerName .'\',
PhoneNum: \ ''. $ phoneNum .'\',
IdType: \ ''. $ idType .'\',
BankCardNum: \ ''. $ bankCardNum .'\',
Email: \ ''. $ email .'\',
CardNo: \ ''. $ cardNo .'\',
Cvv2: \ ''. $ cvv2 .'\',
ExpiryDate: \ ''. $ expiryDate .'\',
Name: \ ''. $ name .'\',
Inclueno: \ ''. $ inclueno .'\',
CashierVersion: \ ''. $ cashierVersion .'\',
ForUse: \ ''. $ forUse .'\',
BindCardId: \ ''. $ bindCardId .'\',
Details: '. $ product .'
},
Function (data, status ){
Alert (data );
If (data = 1 ){
Alert (\ 'server processing succeeded \');
} Else {
Alert (\ 'server processing failed \');
}
}
);
Reply to discussion (solution)
Public function orderAction ()
{
// $ MerchantId =$ _ POST ['merchantid'];
// Echo '. $ merchantId .';
Echo '20140901 ';
}
This is the orderAction () method in my class OnlinePayController.
Where did your pile of code be written?
Check whether the error is correct in the browser.
Where did your pile of code be written?
Check whether the error is correct in the browser.
On a page written in the background, I transfer the background data to the foreground page, which is equivalent to a front-end button generated in the background, the onclick event of this button executes this $ post ()..............
I have found the answer. This is a class method. First, instantiate this class OnlinePayController and then call the orderAction () method in it.