Some php skills and precautions. From the browser, the header (location) is used to jump to another page, but in fact, php will still execute the background code, if the following code has insecure logic, from the browser, the header (location) is used to jump to another page, but in fact, php will still execute the background code, if the following code has insecure logic, then, we directly ignore the conditions set by the developer and continue to execute the following things.
For example:
The code is as follows:
If (true)
{
Header ('Location: http://www.jb51.net ');
}
File_put_contents('test.txt ',' OK ');
In this code, careless programmers will think the header ('Location: http://www.jb51.net '); over, in fact, the background code is still executed, so use header (location) whether it is encapsulated in another function or written directly, we recommend that you add exit () to the end to confirm that the program is suspended.
=== Soap
A "Class 'soapclient' not found" error occurred while running a demo code today. After searching, you need to start the soap service, but in php. no soap is found in Windows Extensions of ini. dll. at first, I thought my php version did not contain this dll. I checked the ext subdirectory under the php installation directory and found that php_soap.dll exists. Simply add extension = php_soap.dll to Windows Extensions and restart apache.
Ssl is not started by default. extension = php_openssl.dll, you can remove it before.
The code is as follows:
Var_dump ($ query); // print the result as text.
$ GLOBALS // save all global variables (only on the current page)
Get_defined_vars () // returns an array composed of all defined variables (including global variables and Super global variables)
Get_defined_constants () // returns an array composed of all defined constants.
Expose header (location) is redirected to another page, but in fact, php will still execute the background code. if there is an insecure logic in the subsequent code, then...