WAP (Wireless communication protocol) is an open global scale for communication between digital mobile phones, personal handheld devices (PDAs) and computers. Because static WAP pages cannot satisfy users' personalized service requests in many aspects, WAP (Wireless communication protocol) is used in digital mobile phones, personal handheld devices (PDAs) and the open global scale of communication between computers. Because static WAP pages cannot satisfy users' personalized service requests in many aspects, the WAP server language produces lively WML pages, it has extensive utilization value and high trade value.
The WAP utilization structure is very similar to the Internet. a typical WAP utilization request is as follows: first, a mobile terminal (such as a WAP mobile phone) with the WAP user proxy function) send a WAP service request to a website via a Micro Browser running internally. The request was first intercepted by the WAP gateway and the information content was encoded and compressed to reduce network data traffic. at the same time, the WAP protocol was converted to the HTTP protocol as needed, then, the processed request is forwarded to the corresponding WAP server. On the WAP server side, based on the extended page name and other properties, the requested page is output directly or indicated by the server script, and then sent back to the user through the gateway.
From the above WAP utilization process, we can see that the process of daily and lively WAP pages is very similar to that of dynamic Web pages. However, because WAP uses the WML language of the application to originate from the strict XML syntax, the request output format must be output according to the WAP webpage specification. At the same time, because of the application scope of the WAP protocol, the mobile client's hardware and software water is equally special, the size of each output page, the image pattern and capacity are limited. Let's take the PHP script language as an example to see how to dynamically output the WAP page.
1. set WEB servers
First, you must install PHP on your Web server to process PHP scripts. Second, to enable the Web server to recognize and process PHP, WML, WBMP and other files at the same time, the following file types must be added to the MIME table of the Web server.
Text/vnd. wap. wml. wml
Image/vnd. wap. wbmp. wbmp
Application/vnd. wap. wmlc. wmlc
Text/vnd. wap. wmls. wmls
Application/vnd. wap. wmlsc. wmlsc
II. use PHP to output a simple dynamic WAP page
The following is a simple example of a PHP native WAP page. Note that the PHP interpreter is required to describe the program and output the WAP page. Therefore, all similar programs should be extended by. php.
Header ("Content-type: text/vnd. wap. wml ″);
Echo (″
″);
Echo date ("l dS of f y h: I: s ″);
Echo (″
″);
?>
This example can be viewed in the WAP mobile phone simulator to output the current date and time, which cannot be identified in a common browser and may even be considered as an incorrect download. This is because the output document is declared as the WML type at the beginning of the program. This type can only be identified and described by WAP devices. It is worth noting that our common HTML language does not have strict requirements for normative requests. most browsers can "tolerate" a large number of compilation errors, while WML standards are quite strict, A single error may result in failure to output the required page.
Once we know the scale process of outputting WAP pages using PHP scripts, we can use the powerful functions of PHP to cooperate with the interactive processing of WML language and the simple Script of WML Script, developed a suitable exploitation system.