Configure PHP + WAP mobile website development environment

Source: Internet
Author: User
Keywords Network programming PHP tutorial
Tags apache browser configure content data development development environment echo

1. Mobile terminal with WAP user agent function (such as WAP mobile phone), send WAP service request to a website through micro-browser running inside. The request is first intercepted by the WAP gateway, encoding and compressing the information content to reduce the network data traffic, and at the same time converting the WAP protocol into the HTTP protocol according to the requirement.

2. The protocol forwards the processed request to the corresponding WAP server. In the WAP server, according to the attributes such as page extensions, the requested page directly or by the server-side script to explain the output, and then returned to the user through the gateway.

Introduced some knowledge Now that the development environment has been set up. Because I use php and apache development wap site. So add the following section in the AddType section of apache's http.conf file.

AddType text / vnd.wap.wml .wml

AddType application / vnd.wap.wmlc .wmlc

AddType text / vnd.wap.wmls .wmls

AddType application / vnd.wap.wmlsc .wmlsc

AddType image / vnd.wap.wbmp .wbmp

AddType image / vnd.wap.wbmp .wbmp

Restart Apache, this is OK

Test code

<? php header ("Content-type: text / vnd.wap.wml"); echo ("<? xml version =" 1.0 "> n"); echo "<! DOCTYPE wml PUBLIC" - // WAPFORUM // DTD WML 1.1 // EN "" http://wapforum.org//DTD//wml_1.1.xml "> n"; echo ("<wml> n <card> n <p>"); echo date ( "L dS of FY h: i A"). "<br /> n"; echo 'Hello World !, Hello'; echo ("</ p> n </ card> n </ wml>"); ?>
Related Article

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.