Home > Backend Development > PHP Tutorial > Codeigniter shopping cart class cannot add Chinese solution_PHP tutorial

Codeigniter shopping cart class cannot add Chinese solution_PHP tutorial

WBOY
Release: 2016-07-13 10:57:25
Original
1138 people have browsed it

Some friends may find that the Codeigniter shopping cart class cannot add Chinese. After searching for a long time, I found that the following piece of code limits the input of Chinese. Let me introduce it to you.

Modify systemlibrariesCart.php and comment the product name judgment on lines 186-190:

/*if ( ! preg_match("/^[".$this->product_name_rules."]+$/i", $items['name']))
The code is as follows
 代码如下 复制代码

/*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; 

  }
*/ 

Copy code

{

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' );

}
*/
However, deleting is not the best way. We can just change the regular matching to Chinese. I will not introduce this, but you can check it out in the PHP tutorial channel.
http://www.bkjia.com/PHPjc/632100.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632100.htmlTechArticleSome friends may find that the Codeigniter shopping cart class cannot add Chinese. After searching for a long time, I found the following code restriction Now that I have entered Chinese, let me introduce it to you. Modify systemli...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template