Home  >  Article  >  Backend Development  >  How to use functions such as I(), U(), $this->post() in ThinkPHP, thinkphpthis-_PHP tutorial

How to use functions such as I(), U(), $this->post() in ThinkPHP, thinkphpthis-_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:13:24937browse

Usage of functions such as I(), U(), $this->post() in ThinkPHP, thinkphpthis-

The examples in this article describe the usage of functions such as I(), U(), $this->post() in ThinkPHP. Share it with everyone for your reference. The specific method is as follows:

In ThinkPHP, you can use the following method to accept form data in a controller:

1. $_POST[]/$_GET[], but the content of this accepted form will not be filtered through the htmlspecialchars(); function. If you want to use this to receive data, you need to manually process the form data

2. You can use the receiving form function

to copy the code The code is as follows:
$this->_post();$this-> _get();
, this function will use htmlspecialchars() for filtering by default, no manual filtering is required.

3. There is a new function I() in thinkphp3.1.3; it directly receives form data and defaults to htmlspecailchars(); it filters this function with these fields I('The name of the form that needs to be received', 'If the data Empty default value', 'Function used to process form data');

U(); The function is the output address

U('operation name', 'array() parameter', 'pseudo-static suffix name', whether to jump, domain name)

I hope this article will be helpful to everyone’s ThinkPHP framework programming.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/916057.htmlTechArticleUsage of functions such as I(), U(), $this-post() in ThinkPHP, thinkphpthis- Examples of this article Describes the usage of I(), U(), $this-post() and other functions in ThinkPHP. Share it with everyone for your reference. The specific methods are as follows...
Statement:
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