PHP output Simple Dynamic WAP page _php tutorial

Source: Internet
Author: User
Of course, there are other methods that can be searched online. I recommend a way to browse both the HTTP page and the WAP page, which is to use the Firefox + wmlbrowser component. Install the Wmlbrowser component of Firefox can support the direct browsing WAP page.
Because of the need to dynamically output content, we have to set the suffix name of the page as. PHP, so how do you let the browser parse it into a WAP page? It's simple, just tell the browser the MIME type of the file when the header file is output.
Copy CodeThe code is as follows:
Header ("CONTENT-TYPE:TEXT/VND.WAP.WML");
?>

With the above sentence, the extension of the file is not important.
The next thing is to write a PHP file on the line, grammar ah function, all the same as usual, remember to export the first XML format header at the beginning,
Copy CodeThe code is as follows:
Echo (' ');
?>

In addition, the format of the text to be written in WML format (also equivalent to XML), the WML specification is very strict, a bit of error may result in the output of the required page.
A WML template is as follows:
Copy CodeThe code is as follows:







Most of the current WAP phones (Nokia7110, Ericsson r320s, etc.) are encoded using UTF-8, which is encoded using Unicode. Thus, if we use the Chinese character (GB2312 encoding) directly in WML, it will be garbled and the phone user cannot recognize it, so we will use the program or function to encode the Chinese Unicode before exporting it. In a small number of mobile phones or WAP devices that support GB2312 encoding, we can directly display Chinese characters after defining the internal code type of the document in the program.

http://www.bkjia.com/PHPjc/320232.html www.bkjia.com true http://www.bkjia.com/PHPjc/320232.html techarticle of course, there are other methods that can be searched online. I recommend a way to browse both the HTTP page and the WAP page, which is to use the Firefox + wmlbrowser component. Install W ...

  • 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.