亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

CodeIgniter不允許使用關鍵字符

CodeIgniter不允許使用關鍵字符

qq_遁去的一_1 2019-09-05 13:05:55
CodeIgniter不允許使用關鍵字符CodeIgniter給了我一個Disallowed Key Characters錯誤。我已經將它縮小到表單字段的name屬性:name='prod[50-4121.5]'但我不知道該怎么做。
查看完整描述

3 回答

?
慕容3067478

TA貢獻1773條經驗 獲得超3個贊

打開libraries/Input.phpsystem/core/Input.php在CI版本2.0+中)并找到function _clean_input_keys($str){,整個塊應如下所示:

function _clean_input_keys($str){
    if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
    {
        exit('Disallowed Key Characters.');
    }

    return $str;}

修改允許新字符的PCRE sot。

請注意,缺少的字符是.(點),你應該總是.在正則表達式中轉義(點),否則它們將允許任何單個字符。

/^[a-z0-9:_\/-\.]+$/i



查看完整回答
反對 回復 2019-09-07
?
Qyouu

TA貢獻1786條經驗 獲得超11個贊

要將CodeIgniter與jQuery Ajax一起使用,請使用“Object”作為數據而不是Query字符串,如下所示:

$.ajax({
    url: site_url + "ajax/signup",
    data: ({'email': email, 'password': password}), //<--- Use Object
    type: "post",
    success: function(response, textStatus, jqXHR){
        $('#sign-up').html(response);
    },
    error: function(jqXHR, textStatus, errorThrown){
        console.log("The following error occured: "+
                    textStatus, errorThrown);
    }});



查看完整回答
反對 回復 2019-09-07
  • 3 回答
  • 0 關注
  • 951 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號