Abstract: when using PHP to create a dynamic Web page, before submitting the page to the server, it is difficult to develop PHP programs to obtain and display the values of other related fields from the database based on the value of a field recorded on the current page.
Abstract: useWhen PHP creates a dynamic Web page, before submitting the page to the server, it is a difficulty in PHP program development to allow PHP to immediately retrieve and display the values of other related fields from the database based on the value of a field recorded on the current page. This document describes how to combine PHP and JavaScript, two embedded HTML languages, with a specific example.
Key words:PHP, dynamic, HTML.
The current website has evolved from a situation where conditions are used for static information to an interactive approach to provide dynamic information services.The Web information service situation can be summarized as two points: providing information to the customer and recording the information submitted by the customer. To provide these two services, the title should be resolved: how to quickly allow users to quickly extract the information they want from a large number of information on their websites, how to effectively record information submitted by users for future user searches. These titles can be solved by participating in database support on the website.
BecausePHP can provide good support for a variety of databases, and PHP scripts are directly embedded in HTML documents, which is very convenient to use. Therefore, PHP is one of the most popular Server-side embedded languages on the Internet. In addition, compared with other Server-side scripting languages such as ASP, PHP provides free open source code and cross-platform support, which makes it easy to adapt to various heterogeneous network environments in today's network; this allows Web page producers to quickly and conveniently create powerful dynamic Web pages. However, because PHP is embedded on the server, it is more intuitive to understand that PHP statements are executed on the server, so it receives and processes the content on the current page only when it is submitted. However, when you need to dynamically extract the content from the database based on the value of a field recorded on the current page of the customer, PHP will be powerless. For example, if you want to provide the customer with a "order contract" recording page, which contains some "supplier information, the specific information of each supplier has been recorded in a "seller" dictionary in advance. now, when the customer selects a "supplier" on the current page, some information of the supplier, such as the "opening bank, account, address, and phone number", is extracted from the "merchant" dictionary table and displayed on the current page for the customer to directly apply or correct the application. Such requests are easy to implement using visual programming languages such as PB and VB, but PB and VB are not suitable for compiling dynamic Web pages. PHP is suitable for compiling dynamic Web pages, however, because the server is embedded and the variable value on the page before submission cannot be obtained in time, it is difficult to implement the above request. During programming, I joined PHP and JavaScript to solve this problem.