Completed a simple and useful WAP website - WAP version of mobile phone number location query address: http://hikey.net/wap
Use a mobile phone that supports WAP to view it. It does not support IE.
If your mobile phone does not support WAP or you are not willing to pay a few cents, you can use an emulator provided by gelon.net to view my works.
Just open this address directly
http://www.gelon.net/cgi-bin/wapalize.cgi?url=http://hikey.net/wap
//The encoding of IE should be Simplified Chinese.
//Press the scroll wheel to scroll down the screen.
Wap Internet access is billed according to traffic. I don't use pictures and there are not many words. It should be cost-effective to query something.
Main code:
<% Response.ContentType="text/vnd.wap.wml" %>
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" " http://www.wapforum.org/DTD/wml13.dtd " >
<wml>
<card id="SJ" title="Mobile phone number location query">
<%
'Database connection
dim connstr1,conn1
const DB="xxx.mdb" 'Mobile phone library path
connstr1="DBQ="+server.mappath(""&DB&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn1=server.createobject("ADODB.CONNECTION")
conn1.open connstr1
'Filter illegal characters
function chk(str)
if str<>"" then
chktopic=replace(str,"'","''")
end if
end function
%>
<%
'Mobile inquiry
if request.form("SJ")<>"" then
d= chk(request.form("SJ"))
'Determine whether it is a number or a number greater than 7 digits
if len(d)>=7 and IsNumeric(d) then
c=left(d,7)
'A lot of code is omitted here
sql="select * from mod where start<="&c&" and end>="&c&" and mid(start,3,1)="&mid(c,3,1)&" and mid(end,3,1 )="&mid(c,3,1)&" and mid(start,4,1)="&mid(c,4,1)&" and mid(end,4,1)="&mid(c,4 ,1)&" and mid(start,5,1)="&mid(c,5,1)&" and mid(end,5,1)="&mid(c,5,1)&" and mid( start,6,1)="&mid(c,6,1)&" and mid(end,6,1)="&mid(c,6,1)&" "
set rs=conn1.execute(sql)
if not rs.eof then
a=rs("city")
b=rs("city1")
e=rs("url")
f=rs("thank")
set rs=nothing
else
a="Sorry, no record of this number found"
end if
else
a="Error: Please make sure you enter a number greater than 7 digits!"
end if
%>
<b>Mobile phone number you searched for:</b><br/>
<%=d%><br/>
<b>Address:</b><%=a%> <%=b%><br/>
<b>Area code and description:</b><br/>
<%=e%> <%=f%>
<br/><br/>
<%end if%>
Please enter your mobile phone number
<input size="8" name="SJ" type="text" maxlength="11" />
<anchor title="OK">OK
<go href="index.asp" method="post">
<postfield name="SJ" value="$SJ"/>
</go>
</anchor>
<p align="center"><b>Hikey.NET</b></p>
</card>
</wml>
<%
set conn1=nothing
%>