photoshop skills analysis of some php skills and precautions

WBOY
Release: 2016-07-29 08:44:23
Original
1005 people have browsed it

From the browser, using header(location) will jump to another page, but in fact, PHP will still execute the background code. If the code behind has unsafe logic, then just ignore the developer. The set conditions continue to be executed.
For example:

Copy code 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 that header('location:http://www.jb51.net'); is over. In fact, the background code is still overwritten. Executed, so when using header(location), whether it is encapsulated in another function or written directly, it is recommended to add exit() at the end to confirm that the program is terminated.
====soap
I ran a demo code today, and the "Class 'SoapClient' not found" error occurred. After searching, I needed to start the soap service, but soap.dll was not found in the Windows Extensions of php.ini. At first, I thought that my PHP version did not contain this dll, so I went to the ext subdirectory of the PHP installation directory and took a look. Found that php_soap.dll exists. That's easy, just add extension=php_soap.dll to the Windows Extensions section and restart apache.
SSL is not started by default, extension=php_openssl.dll, you can just remove the ";" in front of it here.

Copy the code The code is as follows:


var_dump( $query );//Print the result as text to view
$GLOBALS //Save all global variables (only in the current page)
get_defined_vars() //Returns an array composed of all defined variables (including global variables, superglobal variables, etc.)
get_defined_constants() //Returns an array composed of all defined constants

The above has introduced photoshop skills and some analysis of PHP skills and precautions, including photoshop skills. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!