PHP Generate Dynamic WAP page (turn two)

Source: Internet
Author: User
Tags date echo date install php php script
Dynamic | Page One, setting up a Web server

First of all, your Web server to install PHP, that can handle PHP script program. Second, to enable the Web server to recognize and process PHP, WML, and wbmp files at the same time, the MIME table for the Web server needs to add the following 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

Second, with PHP output simple dynamic WAP page

Here is an example of the simplest PHP-generated WAP page. Note that because you need a PHP interpreter to interpret the program and output a WAP page, all similar programs should have the. php extension.

<?php
Header (″content-type:text/vnd.wap.wml″);
Echo (″<wml> <card> <p>″);
echo Date (″l DS of F Y h:i:s A″);
Echo (″</p></card></wml>″);
?>

This example can be browsed in the WAP phone simulator, output the current date time, and in the ordinary browser is not recognized, and may even be considered a wrong download. This is because the output document is declared as a WML type at the beginning of the program, and only the WAP device can recognize and interpret it. It is worth noting that our common HTML language is not stringent requirements, most browsers can "tolerate" a considerable number of writing errors, and the WML specification is very strict, a bit of error can lead to the inability to output the required pages.

Once we know the standard process of exporting WAP pages with PHP scripts, we can use PHP's powerful capabilities to work with the WML language interaction and simple WML scripts to develop the application system that suits our needs.





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.