PHP, the hegemony of the 21st century (3)

zhaozj2021-02-16  45

4. Quick advancement

The steps to implement a project with PHP-oriented mechanisms are as follows: • First, you need to connect a database SQL server - there are two options: AdoDB (Active Data Objects Data Base), dynamic data object database (http: // PHP.Weblogs.com/adodb)

Metabase (Database Independent Access And Management), ie database independent access and management (http://phpclasses.upperdesign.com/browse.htm/package/20)

· Second, you need some universal PHP classes to create forms, tables, and other HTML objects. These can get (http://phpclasses.upperdesign.com) on the PHP Classes website. You can refer to the download list of the site. You can also get the form class, template class, etc. from the website http://www.milkywaygalaxy.freeservers.com/. · Third, by inheritance of these general-class, you can design and create your own PHP class. · Fourth, use the template class to separate display style and business logic, see http://www.phpclasses.com · Fifth, develop using the IDE tool (see PHP IDE section). · Finally, it is best to encapsulate your code into classes, so you can realize the easy maintenance and reusability of code.

5. Main features of php

· Support standard CGI, FastCGI, and Apache modules - as a standard CGI program, PHP can be installed on any UNIX machine running any web server. PHP supports new FastCGI standards, with this mechanism, PHP has improved speed. When configured as an Apache module, PHP has become a new selection that is extremely powerful, running, such as lightning.

· Access Log - Use the PHP log access function, users can maintain their clicks and logs. This feature provides real-time access monitoring without accessing the log file in any way. Log Browse scripts provide fast access summary for a set of pages owned by your personal user. In addition, the package can also display access information by configuring a footer to each page. Refer to the example behind the article.

• Access Control - An built-in web-based configuration "screen" can realize the configuration of access control. In this way, it is possible to create a set of rules for all or part of the web page so that specific people with these pages can set various restrictions on his webpage, such as, what kind of person can access these pages and what kind of these pages The way is accessed. There are many ways to set the page, such as password protection, fully restriction, login failure, or more of the other documents involved in the customer's domain, browser, E-mail address, and even other documents.

· Support PostgressQL - PostgressQL is an advanced but free RDBMS (relational database management system). PHP supports "SQL Query Statement" directly embedded directly in .html file.

· Support RFC-1867 file upload - file upload is a new feature of Netscape2.0. Users can upload files to the web server. PHP provides the actual MIME decoding function that makes the file upload possible. PHP also provides additional frameworks to perform some useful processing on the received upload file.

· HTTP-based authentication control --PHP can be used to create custom HTTP-based authentication mechanisms for the Apache server.

· Variables, arrays, joint arrays - PHP support Typed (this word doesn't know how to translate, high-point guidance) variables, arrays, even perl style joint arrays. These can be passed from one page to another from a page through a form of GET or POST method. · Conditional statement, while loop --php is a complete scripting language similar to C language. You can use the IF / THEN / ELSEIF / ELSE / ENDIF condition statement, and the WHILE loop and switch / case statement to schedule the logic flow displayed by the HTML page.

· Extended regular expressions - regular expressions are frequently applied to pattern matching, mode replacement, and general string operations. PHP supports all common formal expressions.

· Original HTTP Header Control - According to a certain condition, let the web page can send a custom original HTTP header to some advanced website designs. A common usage is to send a local: URL header, redirect the request to another URL. You can also use the latest updated HTTP headers to close the cache or action page.

· Dynamic Creating GIF Pictures --PHP has supported the Thomas Boutell's GD image library, which can realize dynamic creation of GIF images.

· Support ISP "Safety Mode" --php supports unique "safe mode", so that multiple users run more securely on PHP scripts on the same server.

· The newly released PHP has added many new features. Access to PHP's primary site http://www.php.net. · PHP is free! - This is the last important feature. PHP packages are completely free. It abides by GNU / GPL. You can use this software to implement business or any other purpose.

5.1 Advantages of PHP relative to Java

PHP is a scripting language that has been identified and used to create a dynamic web page. As a language specifically designed for web, PHP brings a number of desires for many commercial institutions.

· Extreme learning cycle · Fast development time · Very high performance

This is very important for companies that lack skilled programmers, time and very urgent companies. PHP can run on all major operational platforms (UNIX, Windows, or even large machines) and is born to support a variety of popular databases. All of this decides that it is an ideal choice for Web development: there is a online store using PHP technology, saying that they only need to hire amateurs, and can develop reusable code within a few days. Those who are familiar with languages ​​such as C, C or Java, always found that they can perform PHP programming within a few hours.

PHP is designed for web development. This fact makes it a unique development tool, just like Intranet Design magazine:

"PHP is to build on the real demand for web developers .... Unlike other cumbersome, high-load methods, PHP is very light, is tailored for web development. It can be faster than other similar technologies. It's easier to solve complex problems. "

As a new programming language, Java initially used to run client applications embedded in your browser. In the past few years, the issues exposed by "Applet" forced Sun and other Java developers to find new ways for this language. The most prominent is the server-side programming, which allows the Web site to connect to the database and generate an application of other server-side applications, ie "servlets". Sun finally launched Java Server Pages (JSP) as a means of writing servlets. Like PHP, JSP also has high portability between different platforms (although PHP supports any 32-bit and 32-bit platforms, JSP can only run on platforms installed in the Java virtual machine). Then, a newcomer without programming background will find that the use of servlets is a very difficult thing because the complexity of the language and the complex design of the JSP system. The performance of JSP also has many places to be improved: ZDNET's online publication Eweek Recent survey found that PHP's running speed is almost 3.7 times the JSP. It can be said that JSP is a very poor solution in a web environment because it can only handle little transactions per second, and the response speed is quite slow.

ZDNET Eweek Magazine also mentioned: "JSP is a relatively new technology, from development tools, resources, talents, have not had a complete market maturity." ... because JSP is based on Java, while Java is a strong type of language, so we have to declare the type of variable and manually convert type in the required place. This makes JSP a scripting language that is the most difficult to learn amateurs.

PHP works with Java work

JSP is just a language that can access Java objects, it is important to realize this. PHP can also integrate Java, which means that PHP can be like JSP, becomes a scripting language that calls Java logic. Different from JSP, PHP can also call other component models, such as Microsoft COM, and increase support for new object models is also extremely easy. It can be seen that PHP's expansion capabilities are endless. On the other hand, JSP is completely dependent on Java.

IBM programmers SAM Ruby combine PHP and Java. Good support for Java via PHP such that Java objects are as transparent as common PHP objects, which is transparently created and used.

The AUTIONWATCH website allows all kinds of commercial groups to benefit from their dynamic bidding environments. Its monthly visit number is more than 200,000; there have been more than 300,000 registered users; 1200,000 auctions are carried out each month. They have tried to use Java, but they still chose PHP, because it is easier to use, the development speed is faster. If you want to know more, please contact Ben Margolin, he is the director of the AUCTIONWATCH website sales service department (Ben@auctionWatch.com).

Programming Consultant Reuven Lerner has compared between a variety of languages. His view of PHP is summarized as follows: "This is the language that is easy to learn. Artists and web designers may say they are not programmers, but in fact, they have more and more JavaScript, VBScript in large projects. And other simple programming languages. Compared with Perl, PHP is more regular and clear; for a newcomer, PHP is easier to master than Java. Indeed, PHP is a bit like JavaScript (if there is a server-side version). No one, No matter how programmed experience, you can learn and use PHP in a short time. This may be VBScript can do it, but Perl and Java are definitely not ..... PHP is definitely an extraordinary, powerful system. No hummony It is possible to create a popular language of the Web site ..... I think PHP will become a strong competitor of Java and JSP, I will recommend PHP in some customers and the company's internal projects. "PHP: has been moving forward The JSP has Sun as its back shield, so it is constantly obtaining the attention of the media. But interesting is that although there is no publicity offensive, PHP's popularity is still growing at 8-11%, far greater than the 4% monthly growth rate of the server-side application. Six hundred and 500,000 sites use PHP (see Netcraft 2001 Survey Report). 39% of the Apache server configured PHP; and Perl accounted for 11% of the market quota, named fourth. Apache maintains a 59% Web server market share; Microsoft times, only 28% (see E-Soft Inc./securityspace 2001 Investigation Report).

Famous companies using PHP include: Unilever, Philips, NTT, Cisco, Japan Airlines, Air Canada, Lufthansa, GE Marketplace, Wallstreet: Online Germany, AuctionWatch, Villagevoic, Dialpad, and BMC. 1.Inet Design Magazine: A IT manager's view to PHP, June 4, 2000. Http://linuxtoday.com/news_story.php3?ltsn=2000-06-04-002-04-NW-HL-SW 2.EWeek: Four Script language speed development, October 30, 2000. Http://www.zdnet.com/eweek/stories/general/0, 11011,2646052,00.html

转载请注明原文地址:https://www.9cbs.com/read-27953.html

New Post(0)