当前位置: 首页 > 图文教程 > 网络编程 > ASP > WAP版的手机号码所在地查询

ASP
ASP下经常用的字符串等函数参考资料
asp下连接数据库 ASP链接数据库字符串大全总结
asp内置对象 ObjectContext 事务管理 详解
asp 内置对象 Application 详解
ASP中 SQL语句 使用方法
ASP 中 Split 函数的实例分析
ASP 中 DateDiff 函数详解 主要实现两日期加减操作
asp 存贮过程 (SQL版asp调用存储过程)
利用ASP实现在线生成电话图片效果脚本附演示
使用ASP记录在线用户的数量的代码
关于ASP生成伪参数技巧 简洁实用的伪(僞)参数
asp 关键词字符串分割如何实现方法
用ASP编写的加密和解密类
ASP之处理用Javascript动态添加的表单元素数据的代码
asp下最常用的19个基本技巧
一些Asp技巧和实用解决方法
asp实现一个统计当前在线用户的解决方案
asp下的一个很简单的验证码程序
asp又一个分页的代码例子
asp实现防止从外部提交数据的三种方法

ASP 中的 WAP版的手机号码所在地查询


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 163 ::
收藏到网摘: n/a

 

完成了一个简单有用的WAP网站--WAP版的手机号码所在地查询
地址: http://hikey.net/wap
用支持wap的手机查看,不支持IE哈

如果你的手机不支持WAP或者不愿意那几分钱的话,可以用gelon.net提供的一个模拟器来看看我的作品   
直接打开这个地址就可以了
http://www.gelon.net/cgi-bin/wapalize.cgi?url=http://hikey.net/wap

//IE的编码要选择简体中文哈
//按滚轮下滑屏幕

wap上网按流量计费,我没用图片,字数也不多
查询点东西应该还算合算哈

主要代码:

<% 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="手机号码所在地查询">
<%
  ' 数据库连接
 dim connstr1,conn1
 const DB="xxx.mdb" '手机库路径
   connstr1="DBQ="+server.mappath(""&DB&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
   set conn1=server.createobject("ADODB.CONNECTION")
   conn1.open connstr1

  '过滤非法字符
function chk(str)
 if str<>"" then
 chktopic=replace(str,"'","''")
 end if
end function
%>
<%
   '手机查询
  if request.form("SJ")<>"" then
  d= chk(request.form("SJ"))
  '判断是否为数字或者大于7位的数字
  if len(d)>=7 and  IsNumeric(d) then
  c=left(d,7)
    
'这里省略了很多代码
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="对不起,没有找到这个号码的纪录"
  end if
  else
  a="错误:请确保你输入的是大于7位的数字!"
  end if 
   %>
<b>您搜索的手机号码:</b><br/>
<%=d%><br/>
<b>所在地址:</b><%=a%> <%=b%><br/>
<b>区号和描述:</b><br/>
<%=e%> <%=f%>
<br/><br/>
<%end if%>

请输入手机号码
<input size="8" name="SJ" type="text" maxlength="11"  />
<anchor title="确定">确定
<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
%>