在Apache上简简单单开个WAP站点

王朝system·作者佚名  2008-05-18
窄屏简体版  字體: |||超大  

现在可以上网的手机越来越多, 要是可以随时在手机上面看到自己的网站的相关信息, 岂不是非常Happy么。

现在就动手,其实很简单。

打开/path/to/httpd.conf:在最后添加以下配置内容

代码:

#Wap MIME

AddType text/vnd.wap.wml .Wml

AddType application/vnd.wap.wmlc .Wmlc

AddType image/vnd.wap.wbmp .Wbmp

AddType application/vnd.wap.wmlscriptc .wmlsc

AddType text/vnd.wap.wmlscript .Wmls

AddType application/vnd.wap/wmlscriptc .Wsc

然后使配置生效。

就这么简单,你的Apache已经可以支持Wap访问了。

来吧:手机打开http://我的网站/index.php,我靠,哪里支持啊。

对不起对不起,忘记说了,手机wap浏览器不是网页浏览器,恐怕整个手机的容量还没有网页浏览器的软件那么大。

用Wap浏览器就得遵守Wap的语言wml了,下面来个简单的例子:

在站点根目录建议wap,在wap里面建立test.wml,内容如下:

代码:

<?xml version="1.0" encoding="GB2312"?>

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"

"http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>

<!-- Possible <head> element here. -->

<head>

<meta forua="true" http-equiv="Cache-Control" content="max-age=0"/>

<meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/>

</head>

<template>

<!-- Template implementation here. -->

<do type="prev"><prev/></do>

</template>

<card id="card1" title="wap" newcontext="true">

<p>

<b>输入:</b><br/>

<input name="SID" size="10" maxlength="50" type="text" format="*N" emptyok="true"/><br/>

<br/>

<anchor title="login">

<go href="request.asp" method="post">

<postfield name="code" value="$SID"/>

</go>Implement!<br/>

</anchor>

</p>

</card>

</wml>

来吧:手机打开http://我的网站/wap/test.wml,我靠,真的支持啊。

这里我就不多讲什么wml语言了,自己去baidu多的是资料啊。

遵循wap的游戏规则,你可以使用php或者cgi来写你的动态wml页面了,把服务器的一些信息给处理后送到wml页面,不就可以随时手机查看站点情况了么?

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航