- $ 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:
- Print "delete selected content ";
Jump Code:
- If ($ del = "true "){
- // Here is the deletion code
- }
$ 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. |