wizards of waverly place PHP output simple dynamic WAP page

WBOY
Release: 2016-07-29 08:40:06
Original
1029 people have browsed it

Of course, there are other methods, which can be found online. I recommend a way to browse both http pages and wap pages, which is to use Firefox + wmlbrowser component. Firefox with the wmlbrowser component installed can support direct browsing of wap pages.
Due to the need to dynamically output content, we have to set the suffix of the page to .php. So how do we let the browser parse it into a wap page? It's very simple, just tell the browser the MIME type of the file when the header file is output.

Copy the code The code is as follows:


header("Content-type: text/vnd.wap.wml");
?>


With the above sentence, the file The extension doesn't matter.
Next, just think of writing a PHP file. The syntax and functions are all as usual. Remember to output the XML format header at the beginning.

Copy the code The code is as follows:


echo ('');
?>


In addition, the text format must be written in wml format (also equivalent to xml). The wml specification is quite strict. Mistakes may result in failure to output the required page.
A wml template is as follows:

Copy the code The code is as follows:









Most current WAP phones (Nokia7110, Ericsson R320S, etc.) use UTF-8 encoding, which is encoded by UNICODE. In this way, if we use Chinese characters (GB2312 encoding) directly in WML, garbled characters will be generated and mobile phone users cannot recognize them. Therefore, before we output Chinese, we must use a program or function to encode the Chinese with UNICODE. In a small number of mobile phones or WAP terminal devices that support GB2312 encoding, we can directly and correctly display Chinese characters after defining the internal code type of the document in the program.

The above introduces the wizards of waverly place PHP to output a simple dynamic WAP page, including the wizards of waverly place. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template