PHP generates WAP page

zhaozj2021-02-16  40

PHP generates WAP page

WAP (Wireless Communication Protocol) is an open global standard for communicating between digital mobile phones, personal handheld devices (PDAs, etc.) and computers. Since the static WAP page does not meet the user's personalized service request in many ways, it has a wide range of application value and high commercial value through the WAP server-side language. The WAP application structure is very similar to the Internet, a typical WAP application request is: First, a mobile terminal (WAP mobile phone, etc.) with WAP user agent function (WAP mobile phone, etc.) via the internal running microwser (Micro Browser) Wireless Send WAP service requests. The request is intercepted by the WAP gateway, encoding the information content to reduce network data traffic, and convert the WAP protocol to the HTTP protocol as needed, and then transfer the processed request to the corresponding WAP server. In the WAP server side, according to the quality of the page extension, the requested page is directly output directly or by the server-side script, the user is returned by the gateway. From the above WAP application process, it can be seen that the generation of dynamic WAP pages and dynamically generating web pages are very similar. However, since the WAP application used by WAP applications from syntax strict XML, the format required to output must be output according to the specification of the WAP page. At the same time, due to the application range of the WAP protocol, the hardware and software level of mobile clients, the size of the page, the size, and capacity of the image, the format and capacity of the image are constrained. Below we take a PHP scripting language as an example to see how to dynamically output the WAP page. First, set the web server first your web server to install PHP, you can handle the PHP script. Second, in order to make the web server can simultaneously identify and process files such as PHP, WML, WBMP, the web server's MIME table needs to add several file types. 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 2, with PHP output The simple dynamic WAP page has an example of the simplest PHP generated WAP page. Note Due to the need for a PHP interpreter to explain the program, and output the WAP page, all similar programs should be extended in .php.

); Echo Date (" L DS of Fe H: i: s A " ); Echo (" ");?> This example can be browsed in the WAP mobile emulator, output the current date time, and cannot identify in a normal browser, even It is considered to be an error download. This is because the output document is declared in the beginning of the program, which only WAP devices can identify and explain. It is worth noting that our common HTML language is not strict, most browsers can "tolerate" in which the WML specification is quite strict, and a little mistake may result in the required page. Once we know the standard procedure for outputting the WAP page with a PHP script, we can use the PHP powerful feature to process the interaction of the WML language and the simple script of WML Script to develop applications that we need. Third, using a PHP dynamically generated image WAP application uses a special black and white image format WBMP. We can use some tools to convert existing images into WBMP format and then use it in the WML document.

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

New Post(0)