Analysis of php function PHP_SELF usage

Source: Internet
Author: User
Analysis of php function PHP_SELF usage

  1. $ Php_self? Variable name = value (instance: $ php_sefl? Id = 0)

Variable names after question marks are custom. Generally, they are named as English names with higher readability (which can be abbreviations ). For example, if we let the link point to a functional block of the program to complete a delete operation, we can name it $ del, which is embodied in the code $ php_self? Del = value. if you click this link, the program will perform the delete operation (of course, the delete operation code must be written separately): link code:

  1. Print "delete selected content ";

Jump Code:

  1. If ($ del = "true "){
  2. // Here is the deletion code
  3. }

$ Php_self can contain multiple parameters. The first parameter usage question (?) Bootstrap. the following parameters are guided with the "and" (&). the format and example are as follows:

Syntax: $ php_self? Variable 1 = value & Variable 2 = value & Variable 3 = value

Example: $ php_self? User = blackhorse & id = write & page = 0 in principle, the end parameters of $ php_self should be written together, however, variables connected with the ampersand can be separated by spaces or other valid symbols (such as the plus sign). sometimes we do need to separate them. for example, to pass the arv verification, the symbols may have some impact, the html code generated after the separation is recognized by arv.

$ Php_self is a very useful built-in variable of php. it is usually used for paging and pre-defined operations. Variables in the tail parameters it carries use $ in php to read, such as the following address: http://bbs.it-home.org/pc/index.php? Page = 3

In this way, the page number is read from the above address and the page content is displayed: $ conts = echo_conts ($ page); echo_conts is a self-developed function used to display the content of each page, the value of the variable $ page is the key, which determines the content range extracted by the program from the library file.

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.