PHP Learning Toolkit-chapter II (sequel)

Source: Internet
Author: User
The page listed above is no more impressive than the normal HTML version listed at the beginning of this chapter. However, passing in different variables will result in the automatic generation of any number of specific pages, and in the previous example, the page is selected by the criteria and not by the author's last name, so the result is no further work. If we add a new book to another company in the database, these examples will be updated automatically to reflect the information.

As you can see from these two different original lists, you cannot view the server scripting from the client side. All plays occur before the original code is delivered to the client. After the WEB server is formed, the original code appears as plain HTML at the other end. This also means that you cannot distinguish which server scripting language is used, unless it is listed in the header (header) or URL. These scripting are written in PHP and MySQL repositories, and in the second part of the book you can learn everything about these technologies.

Many jobs and finishes are available in either the user-side or the server-side approach. For example, the user-side way of sending e-mail is to open a blank e-mail window with the client mail application when the user presses the mailto wring chain knot, but using the server method is to have the user fill out the form, where the content is formatted as e-mail, and through an SMTP Sent by the server. You can also choose between user-side methods and server-side methods for browser detection, form validation, drop-down lists, and arithmetic operations. Sometimes, there are some slightly important differences in their functionality (on the server side, the drop-down list is dynamically generated and the client is not), but not all.

How do you choose? Please start by understanding your users. The server-side approach is generally slower to execute, because additional transfers are made, but there are no assumptions about the browser capabilities of the visitor, and the developer has relatively little time to maintain. This makes them well suited to the general mass market and educational sites. If you can be absolutely sure that your visitors have updated browsers and a higher amount of access, you can freely scripting language and mapping. Finally, keep in mind that you can use PHP to generate static HTML and JavaScript, so that you can take into account two general directions, followed by a more in-depth explanation of the comparison.

The scripting of servo-end is good at

The client and the server each have the advantage, the servo side scripting lacks the visual attraction on the presentation. Most Web users, even if they are not hourly, are at least on a daily basis with the servo-scripting finished products.

And like "Even 3D shootout movie" This kind of thing is the server absolutely can not help to complete. The more immediate and denser the response the project needs, the less suitable it is to implement it with PHP. At the moment, the Web is too slow for these purposes (though elites in the broadband sector are trying to change that).

On the other hand, the aspects of the server scripting such as PHP that can perform well on the Web are:

Content sites (including production and display)

Sites that belong to the community (like forums, announcements, ...). such as

e-mail (Webmail, mail forwarding, sending by WEB application)

Customer support and technical support systems

Advertising Network

Applications for Web delivery and delivery services

List of directories and members

Surveys, polls and tests

Online fill-in and form submission

Personalized Technology

Group Software

catalogs, brochures and information sites

It basically includes any other applications that need to connect back-end servers (repositories, mail, LDAP, and so on) to the WEB server.

PHP is able to handle the basic tasks listed above.

Through the foregoing, readers should now have a sense of the difference between the client and the server technology, then the hands-on practice. The next chapters will talk about how to get, install, and set up PHP (or someone else to do it for you).

Due to the recent rapid development of programming languages, the differences between programming and scripting languages have gradually become blurred. For example, PHP itself uses the same control structure as other program design languages. However, the HTML embedded language, such as ASP, is still considered to be located on the side of the scripting language, and the binary code compiled separately is a relatively distinct label for the program design. But since PHP4 is now dynamically compiled (the compiled binaries are saved and reused until the original code is changed), it is formally a "real" programming language, a change that illustrates the speed of PHP4, which has been summed up in the same class as Perl.

Summary

It is important to know what PHP (or any other Server scripting language technology) can do, and how to divide the work between the client and the servers. In this chapter, we use examples to demonstrate common static HTML, HTML for the client to produce effects (such as Java Script and CCS), and a Web page generated by PHP from the server and client side.

The client-side scripting language is visually appealing and can respond quickly to user input, but any content that goes beyond the most basic HTKL will be affected by the browser's differences. Static user-side scripting also require more time for developers to maintain and update, since pages cannot be automatically generated based on changing data access. The server-side programming and scripting languages, such as PHP, can connect databases and other servers to Web pages.

PHP4 is architecturally different from some other server-side tools, even with PHP3. It is dynamically compiled, which makes it faster to execute. PHP4 even separated the scripting engine (Zend) from the scripting language.

The above is the PHP learning Treasure-Chapter II (sequel) of the content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.