【发布时间】:2023-03-23 22:16:01
【问题描述】:
自过去 8 个月以来我一直在使用这个项目,它工作得非常好。我的 api 调用如下所示
webservice 代码是这样的
public function __construct(){
parent::__construct();
$this->load->model('Webservice_model');
$type = isset($_REQUEST['type']) ? trim($_REQUEST['type']) : '';
if(empty($type)){
$result['Action'] = "0";
$result['message'] = 'Required parameter missing.';
$result['errMsg'] = 'ERR_MISSING_TYPE';
$result['REQUEST_PARAM'] = $_REQUEST;
$result['REQUEST_PARAM_CI'] = $this->input->get();
echo json_encode($result);
exit;
}
输出看起来像这样 https://prnt.sc/vvhj9f
由于此代码之前运行良好,但在更改域名后突然停止运行。
如果我使用 $_REQUEST 方法,它会返回我的 url 而不是返回参数。
$this->input->get(); 工作完美。
但我不能使用 $this->input->get();,因为我在代码中的任何地方都使用了 $REQUEST 方法,因为它之前工作过。
能否请您让我找出发生这种情况的原因。
【问题讨论】:
标签: php codeigniter url request codeigniter-3