- $php _self? variable name = value (instance: $php _sefl?id=0)
Copy CodeThe variable name that follows the question mark is custom, and is typically named in the English name (which can be abbreviated) that is more readable, as needed. For example, we have the link to a function block of the program is to complete a delete operation, then we can be named $del, reflected in the code is the $php_self?del= value, if clicked on the link, the program performs the delete operation (of course, delete operation code to be written separately): Link code:
- Print "Delete Selection";
Copy CodeJump code:
- if ($del = = "true") {
- Here is the delete code
- }
Copy Code$php _self can take multiple parameters, the first parameter uses the problem (?) boot, and the following parameters are guided with the "and" (&) format and examples 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, $php the trailing parameters of the _self should be concatenated, but the variables connected with the number can be separated by spaces or other valid symbols (such as the + number)-- Sometimes we do need to separate them, for example, to pass the ARV verification, the symbol & will have some influence, the HTML code generated after separating is recognized by ARV. $php _self is a very useful built-in variable for PHP, often used for paging, performing predefined operations, and so on. Each variable in the trailing parameter that it takes is read in PHP using $, such as the following address: http://bbs.it-home.org/pc/index.php?page=3 This reads the page numbers from the above address and displays the contents of the pages: $conts =echo_conts ($page); Echo_conts is a self-coding function that displays the contents of each page, and the value of the variable $page is the key, which determines the range of content that the program extracts from the library file. |