如何解決CI框架的Disallowed Key Characters錯(cuò)誤提示_PHP教程
推薦:解析PHP實(shí)現(xiàn)下載文件的兩種方法本篇文章是對(duì)使用PHP實(shí)現(xiàn)下載文件的兩種方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下 方法一: 復(fù)制代碼 代碼如下: header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filen
用CI框架時(shí),有時(shí)候會(huì)遇到這么一個(gè)問題,打開網(wǎng)頁,只顯示 Disallowed Key Characters 錯(cuò)誤提示。有人說 url 里有非法字符。但是確定 url 是純英文的,問題還是出來了。但清空瀏覽器歷史記錄和cookies后。 刷新就沒問題了。有時(shí)候。打開不同的瀏覽器。有的瀏覽器會(huì)有問題。有的就不會(huì)。
解決 CodeIgniter 框架應(yīng)用中,出現(xiàn)Disallowed Key Characters錯(cuò)誤提示的方法。找到/system/core文件夾下的Input文件,將下面的代碼:
function _clean_input_keys($str)
{
if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
{
exit('Disallowed Key Characters.');
}
// Clean UTF-8 if supported
if (UTF8_ENABLED === TRUE)
{
$str = $this->uni->clean_string($str);
}
return $str;
}
改為:
function _clean_input_keys($str)
{
$config = &get_config('config');
if ( ! preg_match("/^[".$config['permitted_uri_chars']."]+$/i", rawurlencode($str)))
{
exit('Disallowed Key Characters.');
}
// Clean UTF-8 if supported
if (UTF8_ENABLED === TRUE)
{
$str = $this->uni->clean_string($str);
}
return $str;
}
分享:PHP系統(tǒng)命令函數(shù)使用分析本篇文章是對(duì)PHP中系統(tǒng)命令函數(shù)的使用進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下 復(fù)制代碼 代碼如下: function execute($cmd) { $res = ''; if ($cmd) { if(function_exists('system')) { @ob_start(); @system($cmd); $res = @ob_get_contents(); @ob_end_clean(); } els
- PHPNOW安裝Memcached擴(kuò)展方法詳解
- php記錄頁面代碼執(zhí)行時(shí)間
- PHP中獎(jiǎng)概率的抽獎(jiǎng)算法程序代碼
- apache設(shè)置靜態(tài)文件緩存方法介紹
- php對(duì)圖像的各種處理函數(shù)代碼小結(jié)
- PHP 關(guān)于訪問控制的和運(yùn)算符優(yōu)先級(jí)介紹
- 關(guān)于PHP語言構(gòu)造器介紹
- php/js獲取客戶端mac地址的實(shí)現(xiàn)代碼
- php5.5新數(shù)組函數(shù)array_column使用
- PHP preg_match的匹配多國語言的技巧
- php 中序列化和json使用介紹
- php采集文章中的圖片獲取替換到本地
PHP教程Rss訂閱編程教程搜索
PHP教程推薦
- 用PHP實(shí)現(xiàn)網(wǎng)頁開發(fā)中的翻頁跳轉(zhuǎn)
- 解析PHP緩存函數(shù)的使用說明
- 動(dòng)態(tài)網(wǎng)頁中直接不讓訪問PHP程序文件
- 加速動(dòng)態(tài)網(wǎng)站 MySQL索引分析和優(yōu)化
- PHP實(shí)例程序:用PHP制作登錄頁面程序
- PHP中的函數(shù)應(yīng)用詳細(xì)解析
- php中瀏覽器關(guān)閉后,能繼續(xù)執(zhí)行的函數(shù)
- PHP無法訪問遠(yuǎn)程mysql的問題分析及解決
- 解析PHP在linxu下的安裝與配置
- 《PHP設(shè)計(jì)模式介紹》第十三章 適配器模式
- 相關(guān)鏈接:
- 教程說明:
PHP教程-如何解決CI框架的Disallowed Key Characters錯(cuò)誤提示
。