Home > Backend Development > PHP Tutorial > PHP Wap development environment configuration_PHP tutorial

PHP Wap development environment configuration_PHP tutorial

WBOY
Release: 2016-07-13 17:39:33
Original
865 people have browsed it

 1. A mobile terminal (such as a WAP mobile phone) with WAP user agent function sends a WAP service request to a certain website through the micro-browser running internally. The request is first intercepted by the WAP gateway, which encodes and compresses the information content to reduce network data traffic. At the same time, the WAP protocol is converted into the HTTP protocol as needed.

 2. The protocol forwards the processed request to the corresponding WAP server. On the WAP server side, based on the page extension and other attributes, the requested page is output directly or after being interpreted by a server-side script, and then transmitted back to the user through the gateway.

After introducing some knowledge, let’s start setting up the development environment. Because I use php and apache to develop wap sites. So add the following part to 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 and it’s OK

Test code:

<ol class="dp-c">
<li class="alt"><span><span>  <?php  </span></span></li><li><span> </span></li><li class="alt"><span>  header(&rdquo;Content-type: text/vnd.wap.wml&rdquo;);  </span></li><li><span> </span></li><li class="alt"><span>  </span><span class="func">echo</span><span>(&rdquo;<?xml version=&rdquo;1.0&rdquo;>
”);  </span></span></li>
<li><span> </span></li>
<li class="alt">
<span>  </span><span class="func">echo</span><span> “<!DOCTYPE wml PUBLIC&rdquo;-</span><span class="comment">//WAPFORUM//DTD WML 1.1//EN&rdquo;&rdquo;http://wapforum.org//DTD//wml_1.1.xml&rdquo;>
”; </span><span> </span>
</li>
<li><span> </span></li>
<li class="alt">
<span>  </span><span class="func">echo</span><span> (”<wml>
<card>
<p>”);  </span>
</li>
<li><span> </span></li>
<li class="alt">
<span>  </span><span class="func">echo</span><span> </span><span class="func">date</span><span>(”l dS of F Y h:i A”).”<br />
”;  </span>
</li>
<li><span> </span></li>
<li class="alt">
<span>  </span><span class="func">echo</span><span> ‘Hello World!,你好’;  </span>
</li>
<li><span> </span></li>
<li class="alt">
<span>  </span><span class="func">echo</span><span> (”</p>
</card>
</wml>”);  </span>
</li>
<li><span> </span></li>
<li class="alt"><span>  ?>  </span></li>
</ol>
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486301.htmlTechArticle1. Mobile terminals (such as WAP mobile phones) with WAP user agent function, through the micro-browser running internally A website sends a WAP service request. The request was first intercepted by the WAP gateway, and the information content...
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