当前位置:编程学习 > php >>

Codeigniter 购物车类不能添加中文解决方法

修改systemlibrariesCart.php,注释第186-190行产品名称的判断:

 代码如下 复制代码

/*if ( ! preg_match("/^[".$this->product_name_rules."]+$/i", $items['name'])) 

     log_message('error', 'An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces'); 

     return FALSE; 

  }
*/ 

不过删除不是最好的办法,我们可以直接把正则匹配改成中文也可以就行了,这个我就不介绍了大家可到php教程频道去查看。

补充:Php教程,常见问题 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,