【问题标题】:How to change the value of request parameter in Code igniter如何在 Codeigniter 中更改请求参数的值
【发布时间】:2021-09-22 01:59:59
【问题描述】:

我阅读了有关输入类https://codeigniter.com/userguide3/libraries/input.html的文档

我想使用输入类更改特定参数的值,但在文档中找不到。

旧代码:

$_GET['name'] = trim($variable);

改为:

$this->input->get('name') = trim($variable);
or
$this->input->name = trim($variable);

但它不起作用。 如何使用 XSS 过滤改变参数的值?

【问题讨论】:

    标签: php codeigniter input codeigniter-3


    【解决方案1】:

    你已经扭转了局面。你没有设置 $this->input - 顾名思义,它是input,你得到

    $variable = trim($this->input->get('name')); 
    

    https://codeigniter.com/userguide3/libraries/input.html

    设置output

    $this->output->set_output( $variable );
    

    https://codeigniter.com/userguide3/libraries/output.html

    【讨论】:

      猜你喜欢
      • 2016-08-17
      • 2023-03-19
      • 1970-01-01
      • 1970-01-01
      • 2011-06-14
      • 1970-01-01
      • 1970-01-01
      • 2022-10-06
      • 1970-01-01
      相关资源
      最近更新 更多