Codeigniter cannot add Chinese to shopping cart class _ PHP Tutorial

Source: Internet
Author: User
The Codeigniter shopping cart class cannot add a Chinese solution. Some may find that the Codeigniter shopping cart class cannot add Chinese characters. After I have been searching for N for a long time, I found that the following code restricts the input of Chinese characters. I will introduce it to you below. A friend who modified systemli may find that the Codeigniter shopping cart class cannot add Chinese characters. After I have been searching for N for a long time, I found that the following code restricts the input of Chinese characters. I will introduce it to you below.

Modify systemlibrariesCart. php and comment out the judgment of the product name in line 186-190:

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;

}
*/

However, deleting a regular expression is not the best solution. you can simply change the regular expression matching to Chinese. I will not introduce it to the php Tutorial channel.

The shopping cart class cannot be added with Chinese characters. After I have been searching for N long, I found that the following code restricts the input of Chinese characters. I will introduce it to you below. Modify systemli...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.