php Codeigniter:您提交的 URI 包含不允许使用的字符

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29780905/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:34:42  来源:igfitidea点击:

Codeigniter: URI you submitted has disallowed characters

phpcodeigniter

提问by Ronak Patel

My URL is:

我的网址是:

https://example.com/c3dlZXRfcmFqdmk5MUBob3RtYWlsLmNvbQ=

When I remove =then it works fine.

当我删除时,=它工作正常。

I have this in config.php

我有这个 config.php

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

Error:

错误:

The URI you submitted has disallowed characters.

How can I allow =or ==signs in URI?

如何允许===登录 URI?

I have tried it by changing this:

我通过改变这个来尝试它:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-='; // added = sign at the end

回答by Angel Doza

In /project-folder-name/application/config/config.php configure this variable:

在 /project-folder-name/application/config/config.php 配置这个变量:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-@\=';

it also works for @ character

它也适用于 @ 字符

回答by Abhijeet Navgire

change in config.phpfile

更改config.php文件

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-\=';

and

$config['enable_query_strings'] = TRUE;

It works for me. Try it yourself!

这个对我有用。自己试试吧!

回答by amba patel

In CI open directory at project-folder-name/application/config/config.phpand configure the variable $config['permitted_uri_chars']:

在 CI 打开目录 project-folder-name/application/config/config.php并配置变量$config['permitted_uri_chars']

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-@\=';

This will work for all special characters

这将适用于所有特殊字符

回答by mohammd salman

first of all you have to encode your id that is pass in url, then in controller you have to decode the id. view:

首先,您必须对传入 url 的 id 进行编码,然后在控制器中您必须对 id 进行解码。看法:

<a href="<?php echo base_url()?>Cinvoice/imei_invoice/<?php echo base64_encode($invoice_list['invoice_id']); ?>" class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="left" title="Final Invoice By Ware House">Primary Order</a>

Controller:

控制器:

when you call fuction that is in library

当你调用库中的函数时

$content = $CI->linvoice->get_imei(base64_decode($invoice_id)); 

回答by Deepu Bhasin

i have got this in address bar

我在地址栏中得到了这个

O9SPVKocvz6Ph7mT+ulXzMhYV2VDao5gfL9BWtdMKdOBL4PnSLc5E8nIBYnj4hdTpaBUUgFmMX+3X24CfzZ3Rw==

O9SPVKocvz6Ph7mT+ulXzMhYV2VDao5gfL9BWtdMKdOBL4PnSLc5E8nIBYnj4hdTpaBUUgFmMX+3X24CfzZ3Rw==

change in config.php file

config.php 文件中的更改

use this

用这个

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-\=+';

$config['permitted_uri_chars'] = 'az 0-9~%.:_-\=+';

its working fine

它的工作正常

回答by A.N

In my CI version 3.11i solved by this :

在我的CI 3.11 版中,我解决了这个问题:

in application/config/config.phpi changed

application/config/config.php我改变了

$config[‘permitted_uri_chars'] = ‘a-z 0-9~%.:_\-‘;

to

$config['permitted_uri_chars'] = '';

and problem solved.

并解决了问题。

My URL was something like this : example.com/product/45/kotlin_toturial(by_avasam.ir) _in_99_lessons

我的网址是这样的: example.com/product/45/kotlin_toturial(by_avasam.ir) _in_99_lessons

.

.