Session by internet experts: we tend to be negligent about the security of PHP applications, or the measures we take are not appropriate. Here we provide you with a general anti-injection anti-cross-site mini-program for your reference only. PHP
As we all know, PHP is the scripting language used to develop websites. However, the following php script code is found during online learning. it can be used to remotely shut down computers, if you know PHP, study it.
The code is as follows:
PHP Chinese garbled characters are generally character sets. encoding mainly involves the following issues.
I. first, PHP webpage code1. the php file encoding should match the webpage encoding.A. If you want to use gb2312 encoding, php needs to
Mb_convert_encoding is used to convert the encoding. I have never understood the concept of program encoding, but now it seems a bit open. However, the English language generally does not have encoding problems. only Chinese data can have this
The htmlmeta and link generated by php are marked in the body tag, and there is a blank line at the top of the browser. 1. html generated using the smarty template in php has a blank line at the top of the browser.
2. use firedebug to find that
Joomla has its own form verification function, which can be easily used for verification. if the verification fails, the input box is marked with a red border when an error is reported. it is clear that the missing items are missing. The usage is as
During the development process, we often take into account the execution efficiency of some php code, so that our program will run more smoothly. here is a simple summary, for more information, see. 1. when file_get_contents can be used to replace
Php code optimization improves MySQl running efficiency. If you encounter similar problems, refer. Several websites of the company are deployed on virtual hosts in the United States. the mysql service on the server suddenly crashes every day, and
Generally, we use the array_merge () function to merge multiple arrays. In fact, the introduction to array operators in the PHP Manual gives us a simpler method, that is, & quot; + & quot; number. let's take a look at the following example to
So that the PHP session will never expire, you may not have encountered such a depressing problem, but I have encountered, very depressed. We have developed a system that can only be used by our customer service staff-limited customer service staff.
Arrays are a type of variables in PHP and are often used in PHP Development. Therefore, it is very important to print the array content using PHP statements.
1. use print_r ($ array/$ var)Print is the meaning of printing, and r is taken from the
In addition to executing php on the web, you can also execute PHP scripts on the command line through PHPCLI (command line interface ).
The code is as follows:
# Execution format without parametersPhp installation directory/bin/php scriptname. php#
For more information about the use of php variables, see.
The code is as follows:
// Reference$ One = "test ";Two = & $ one; // equivalent to the transfer address. the two variables point to an address.// Dynamic variables$ One = "######";$ Two =
To facilitate input and reduce the number of text boxes that appear when the decoration and editing module is used, you need to enter two or three different content in one box, and then use some special characters to separate them, use explode to
PHP upload is also a common function of php. it mainly focuses on the client and server applications. it is much simpler than asp. I. HTML code for uploading forms
The code is as follows:
Note: 1. action is a new Upload
2. the enctype
Function array_walk (): a single array callback function-applies user functions to each member in the array.
The code is as follows:
/* Function array_walk (): Single array callback function-applies user functions to each member in the array* 1.
Php getting started to learn how to read and write php files. you can use the following two functions to read files: fread, file_get_contents
The code is as follows:
// Open the fileUsing fpw.fopen('tmp.html ', 'r ');// You can use the
Interested in the open-source community and php. I have a little time to understand the simple functions of php.
Topic: Simple PHP functions
Brief introduction: PHP is simple and clear function syntax
Suitable for: interested in open-source
Empty () only detects variables, and any non-variables will cause parsing errors. In other words, the following statement does not work: empty (addslashes ($ name ))
Empty-check whether a variable is empty
Report a bug description
Bool empty (mixed
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