thinkphp I (), U (), $this->post () _php instance of function usage

Source: Internet
Author: User
The examples in this paper describe the use of functions such as I (), U (), $this->post () in thinkphp. Share to everyone for your reference. Here's how:

In thinkphp, you can use the following methods to accept the form's data in the controller:

1, $_post[]/$_get[], but this accepted form content will not be filtered by htmlspecialchars (); If you want to use this to receive data, you need to process the form data manually

2, you can use the Receive form function to copy code code as follows: $this->_post (), $this->_get (), this function will be filtered by default using Htmlspecialchars (), without manual filtering.

3, there is a new function I () in the thinkphp3.1.3, directly receive the form data, and the default is Htmlspecailchars (); Filter This function has these fields I (' need to receive table sole name ', ' if the data is null default value ', ' use the function to process the form data ') ;

U (); function is output address

U (' Operation name ', ' array () parameter ', ' pseudo static suffix name ', jump, domain name)

It is hoped that this article will be helpful to everyone's thinkphp framework design.

  • Related Article

    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.