In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article shows you how to make the file PHP upload effective, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
PHP after a long period of development, many users are very familiar with PHP, here I would like to publish a personal understanding, and discuss with you. PHP is a server-side scripting language for creating dynamic WEB pages. Like ASP and ColdFusion, users can write WEB pages using a mixture of PHP and HTML. When visitors browse to the page, the server will first process the PHP commands in the page, and then transmit the processed results to the browser of the visiting side together with the HTML content.
The Construction Software piny of PHP Local Test Environment based on nginx
Detailed explanation of the characteristics and Application of PHP5.3 closure
International Enhancement of PHP 6: the era of Unicode programming is coming
The beginning of PHP Development tool VS.PHP under Visual Studio
The father of PHP left Yahoo and said he "left the best job."
But unlike ASP or ColdFusion, PHP is an open source program with good cross-platform compatibility. Users can run PHP on Windows NT systems and many versions of Unix systems, and PHP can be run as a built-in module or CGI program in the Apache server. In addition to precisely controlling the display of WEB pages, users can also send HTTP headers using PHP. Users can set cookies through PHP, manage user identity, and redirect users to browse the page. PHP has a very powerful database support function, which can access almost all the popular database systems at present. In addition, PHP can be integrated with multiple external libraries to provide users with more practical functions, such as generating PDF files.
Users can enter the PHP command code directly into the WEB page, so no special development environment is required. In the WEB page, all PHP code is placed in "". In addition, the user can also choose to use a form such as. The PHP engine automatically recognizes and processes all code on the page that lies between the PHP delimiters.
The syntax structure of PHP scripting language is very similar to that of C language and Perl language. The user does not need to declare the variable before using it. The process of creating an array using PHP is also very simple. PHP also has basic object-oriented component functions, which can greatly facilitate users to effectively organize and package their own code. Here I would like to introduce you to the question of PHP upload.
Example 1. Make file PHP upload effective
Check the functions is_uploaded_file () and move_uploaded_file () for further information. The following example handles file uploads provided by the form.
Scripts that accept PHP upload files should implement any logically necessary checks in order to determine what to do with the file next. For example, you can use the $_ FILES ['userfile'] [' size'] variable to exclude files that are too large or too small, or you can use the $_ FILES ['userfile'] [' type'] variable to exclude files whose file types do not match a certain standard, but only regard this as a * * step in a series of checks, because this value is completely controlled by the client and is not checked on the PHP side. Since PHP 4.2.0, you can also use the $_ FILES ['userfile'] [' error'] variable to plan what to do next depending on the error code. In any case, either delete the file from the temporary directory or move it somewhere else.
If the uploaded file is not selected in the form, the value of the PHP variable $_ FILES ['userfile'] [' size'] will be 0. files ['userfile'] [' tmp_name'] will be empty. If the file is not moved elsewhere or renamed, it will be deleted at the end of the form request.
The above content is how to make the file PHP upload effective, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.