現(xiàn)在可以上網(wǎng)的手機越來越多, 要是可以隨時在手機上面看到自己的網(wǎng)站的相關(guān)信息, 豈不是非常Happy么?,F(xiàn)在就動手,其實很簡單。打開/path/to/httpd.conf:在最后添加以下配置內(nèi)容
#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已經(jīng)可以支持Wap訪問了。
來吧:手機打開http://我的網(wǎng)站/index.php,我靠,哪里支持啊。
對不起對不起,忘記說了,手機wap瀏覽器不是網(wǎng)頁瀏覽器,恐怕整個手機的容量還沒有網(wǎng)頁瀏覽器的軟件那么大。用Wap瀏覽器就得遵守Wap的語言wml了,下面來個簡單的例子: <wml> 來吧:手機打開http://我的網(wǎng)站/wap/test.wml,我靠,真的支持啊。 這里我就不多講什么wml語言了,自己去baidu多的是資料啊。
在站點根目錄建議wap,在wap里面建立test.wml,內(nèi)容如下:
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"
<!-- 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>
遵循wap的游戲規(guī)則,你可以使用php或者cgi來寫你的動態(tài)wml頁面了,把服務(wù)器的一些信息給處理后送到wml頁面,不就可以隨時手機查看站點情況了么??。?!