PHP dynamic WAP page 2_php tutorial

Source: Internet
Author: User
PHP generates dynamic WAP page 2. 1. set up a WEB server first, you must install PHP on your Web server to process the PHP script program. Second, to enable the Web server to recognize and process PHP, WML, WBMP and other files at the same time, Web 1. set the WEB server
First, you must install PHP on your Web server to process PHP scripts. 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
2. use PHP to output simple dynamic WAP pages
The following is an example of the simplest php wap page generation. Note that because the PHP interpreter is required to interpret the program and output the WAP page, all similar programs should use the. php extension.
$ #@ 60 ;? Php
Header ("Content-type: text/vnd. wap. wml ″);
Echo ("$ # @ 60; wml $ # @ 62; $ # @ 60; card $ # @ 62; $ # @ 60; p $ # @ 62 ;″);
Echo date ("l dS of f y h: I: s ″);
Echo ("$ # @ 60;/p $ # @ 62; $ # @ 60;/card $ # @ 62; $ # @ 60;/wml $ # @ 62; ″);
? $ #@ 62;
This example can be viewed in the WAP mobile phone simulator and 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. only WAP devices of this type can recognize and interpret this type. It is worth noting that our common HTML languages do not have strict compliance requirements. 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 standard process of outputting WAP pages using PHP scripts, we can use PHP's powerful functions to work with WML language interaction and WML Script simple scripts, developed an application system suitable for our needs.

First, you must install PHP on your Web server to process PHP scripts. Secondly, to enable the Web server to recognize and process PHP, WML, WBMP, and other files at the same time, Web...

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.