问题
The form action works fine on localhost, however it doesn't work on server.
When I click the button pay now on localhost it directs me to the correct URL. But on server it directs me to mywebsite.com/Gateways/Migs/hitmigs
.
Here is the code in migs:-
$form = '<form action="'.base_url('Gateways/Migs/hitmigs').'" method="post" accept-charset="UTF-8">
<input type="hidden" name="Title" value = "Migs Transaction - PHPTravels">
<input type="hidden" name="virtualPaymentClientURL" size="65"
value="https://migs.mastercard.com.au/vpcpay" maxlength="250"/>
<input type="hidden" name="vpc_Version" value="1" size="20" maxlength="8"/>
<input type="hidden" name="vpc_Command" value="pay" size="20" maxlength="16"/>
migs in controller folder
<?php if (!defined('BASEPATH')) exit ('No direct script access allowed');
class Migs extends MX_Controller{
public function hitmigs(){
$redirect_url = "";
require_once(__DIR__."/../migs/PaymentCodesHelper.php");
include_once(__DIR__."/../migs/VPCPaymentConnection.php");
include_once(__DIR__."/../migs/PHP_VPC_3Party_Order_DO.php");
redirect($redirect_url);
I have tried to change PHP versions to 5.5 and 5.6 and asked hosting company to change []
to array()
来源:https://stackoverflow.com/questions/58677100/payment-form-action-work-on-localhost-but-is-not-working-on-server