问题描述
MicrosoftVBScript运行时错误错误'800a000b'被零除/news.asp,行183------------------------下面是代码。在dream8看的的183行的代码【<%functionshowpage(totalnumber,maxperpage,filename)dimn,iiftotalnumbermodmaxperpage=0thenn=totalnumbermaxperpageelsen=totalnumbermaxperpage+1endifresponse.write"<formmethod=postname=myformaction=ru_query.asp>"response.write"<tralign=center><tdbgcolor=#eeeeeecolspan=3fontcolor=#333333>"ifCurrentPage<2thenresponse.write"共有"&totalnumber&"篇文章|首页|上一页|"elseresponse.write"共有"&totalnumber&"篇文章|<ahref="&filename&"?page=1>首页</a>|"response.write"<ahref="&filename&"?page="&CurrentPage-1&">上一页</a>|"endififn-currentpage<1thenresponse.write"下一页|尾页|"elseresponse.write"<ahref="&filename&"?page="&(CurrentPage+1)&">"response.write"下一页</a>|<ahref="&filename&"?page="&n&">尾页</a>|"endifresponse.write"页次:"&CurrentPage&"/"&n&"页|"response.write""&maxperpage&"篇页"】------------------------------下面是整套源码----------------------------------------------------
解决方案
解决方案二:
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"><title>新闻资讯域名抢注域名交易域名注册包你发b08.com</title><metacontent="域名抢注域名交易域名注册包你发b08.com"name="keywords"><metacontent="域名抢注域名交易域名注册包你发b08.com"name="description"><linkhref="/images/b08.css"rel="stylesheet"type="text/css"><style>#newmainlistli{width:290px;overflow:hidden;text-overflow:ellipsis;text-decoration:none;}#tNews{font-family:微软雅黑,黑体;font-size:18px;color:#000000;}#tNewsli{width:370px;overflow:hidden;text-overflow:ellipsis;text-decoration:none;padding:5px0px0px5px;}#tNewsa{color:#000000;}</style><scriptsrc="/table.js"></script><!--#includefile="Conn.asp"--><%dimrs,sqldimtotalPutdimCurrentPage,TotalPagesifnotisempty(request("page"))thencurrentPage=cint(request("page"))elsecurrentPage=1endifsetrs=server.createobject("adodb.recordset")%></head><body><tablewidth="986"cellspacing="0"cellpadding="0"align="center"id="topbar"border="0"><tr><tdalign="center"rowspan="3"width="150"><imgsrc="/images/search_img.png"></Td><tdid="menulist"height="40"><ahref="/"class="hot">已备案域名</a><ahref="/index.asp?gxz=yahoo">高外链域名</a><ahref="/index.asp?gxz=pr">高pr域名</a><ahref="/domain/">域名注册</a><!--<ahref="/domainpark/">域名停放</a>--><ahref="#">域名资讯</a><ahref="/user/index.asp">会员中心</a><ahref="/down/">资源下载</a><ahref="/about.asp">关于我们</a></td></tr><tr><tdheight="31"valign="top"><tablecellspacing="0"cellpadding="0"><formaction="/index.asp"name="searchForm"target="_blank"><tr><td><divclass="topinput"><selectname="types"><optionvalue="whois">Whois信息查询</option></select><inputtype="text"size="70"name="query"value=""></div></td><td> <inputtype="submit"value="搜索"class="bt2"></td></tr></form></table></td></tr><tr><tdvalign="top"height="21"></td></tr></table><scriptsrc="/js/pngfix.js"></script><styletype="text/css">.divSlt{position:absolute;font-size:12px;}.divSltspan{display:block;width:100%;background:url(/images/n/td.gif)rightcenterno-repeat;text-indent:6px;cursor:pointer;margin-top:2px;padding-top:2px;}.divSltul{display:block;background-color:#FFFFFF;width:100%;border:2pxsolid#4E8DBB;border-top:0px;margin:0px;padding:0px;list-style:none;}.divSltulli{text-indent:5px;height:20px;line-height:20px;cursor:pointer;}</style><scriptsrc="/js/select.js"></script><script>instSelect(document.searchForm.types);</script><divid="homelink">当前位置:<ahref="/">首页</a>-新闻中心</div><divid="main"><tablewidth="100%"cellpadding="0"cellspacing="0"border="0"><tr><!--左--><tdvalign="top"><tablewidth="100%"border="0"align="center"cellpadding="0"cellspacing="10"><tr><tdheight="16"><TABLEwidth="100%"border=0align="center"cellPadding=4cellSpacing=1bgcolor="#CCCCCC"class="table"><tralign="center"><tdwidth="18"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>ID</strong></font></td><tdwidth="386"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>新闻标题</strong></font></td><tdwidth="75"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>阅读次数</strong></font></td><tdwidth="95"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>添加者</strong></font></td><tdwidth="100"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>文章来源</strong></font></td><tdwidth="100"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>添加日期</strong></font></td></tr><TRbgcolor="#FFFFFF"><TDcolspan="6"><%sql="select*fromarticleorderbyarticleiddesc"rs.opensql,conn,1,1ifrs.eofandrs.bofthenresponse.write"<palign='center'>没有找到任何文章</p>"elsetotalPut=rs.recordcountifcurrentpage<1thencurrentpage=1endifif(currentpage-1)*MaxPerPage>totalputthenif(totalPutmodMaxPerPage)=0thencurrentpage=totalPutMaxPerPageelsecurrentpage=totalPutMaxPerPage+1endifendififcurrentPage=1thenshowContentshowpagetotalput,MaxPerPage,"index.asp"elseif(currentPage-1)*MaxPerPage<totalPutthenrs.move(currentPage-1)*MaxPerPageshowContentshowpagetotalput,MaxPerPage,"index.asp"elsecurrentPage=1showContentshowpagetotalput,MaxPerPage,"index.asp"endifendifrs.closeendifsubshowContentdimii=0dowhilenotrs.eof%><tr><tdwidth="18"align="center"bgcolor="#FFFFFF"class="hittd"><b><%=i+1%></b></td><tdwidth="386"bgcolor="#FFFFFF"><fontcolor="#333333"><ahref="news.asp?id=<%=rs("articleid")%>"target="_blank"title="<%=rs("title")%>"><%=rs("title")%></a></font></td><tdwidth="75"align="center"bgcolor="#FFFFFF"class="hittd"><fontcolor="#333333"><%=rs("hits")%></font></td><tdwidth="95"align="center"bgcolor="#FFFFFF"><fontcolor="#333333"><%ifnotisnull(rs("writer"))then%><%=rs("writer")%><%else%>不详<%endif%></font></td><tdwidth="100"align="center"bgcolor="#FFFFFF"class="hittd"><%=rs("writefrom")%></td><tdwidth="100"align="center"bgcolor="#FFFFFF"class="hittd"><fontcolor="#333333"><%ifrs("dateandtime")=date()then%><%=year(rs("dateandtime"))%>-<%=month(rs("dateandtime"))%>-<%=day(rs("dateandtime"))%><%else%><%=year(rs("dateandtime"))%>-<%=month(rs("dateandtime"))%>-<%=day(rs("dateandtime"))%><%endif%></font></td></tr><%i=i+1ifi>=MaxPerPagethenexitdors.movenextloopendsub%></table>
解决方案三:
<spanclass="font"><%functionshowpage(totalnumber,maxperpage,filename)dimn,iiftotalnumbermodmaxperpage=0thenn=totalnumbermaxperpageelsen=totalnumbermaxperpage+1endifresponse.write"<formmethod=postname=myformaction=ru_query.asp>"response.write"<tralign=center><tdbgcolor=#eeeeeecolspan=3fontcolor=#333333>"ifCurrentPage<2thenresponse.write"共有"&totalnumber&"篇文章|首页|上一页|"elseresponse.write"共有"&totalnumber&"篇文章|<ahref="&filename&"?page=1>首页</a>|"response.write"<ahref="&filename&"?page="&CurrentPage-1&">上一页</a>|"endififn-currentpage<1thenresponse.write"下一页|尾页|"elseresponse.write"<ahref="&filename&"?page="&(CurrentPage+1)&">"response.write"下一页</a>|<ahref="&filename&"?page="&n&">尾页</a>|"endifresponse.write"页次:"&CurrentPage&"/"&n&"页|"response.write""&maxperpage&"篇页"response.write"</td><tdcolSpan=3bgColor=#eeeeee><tablewidth=80%border=0cellspacing=0cellpadding=0cellpadding=1align=center><tr><tdalign=center>"response.write"新闻搜索:<inputtype=textname=keywordsize=15maxlength=50class=inputstyle='font-size:9pt;height:18;width:101'></td><tdalign=center>"response.write"<inputname=Submittype=imagesrc=images/search.gif></td></tr></table>"response.write"</td></tr>"response.write"</form>"%></span><%endfunctionsetrs=nothingconn.closesetconn=nothing%></td></tr></table></td><tdvalign="top"width="190"><divid="f1"><divid="fTitle"><ul><li><imgsrc="/images/comment_add.gif"align="absmiddle"> <ahref="http://www.itbeian.com"class="redfont">备案米库</a>注册用户请登陆:</li></ul></div><divid="fMain"><style>.lli{padding:7px0px3px10px;}</style><scriptlanguage="JavaScript"><!--functionshowCodeimg(){if(document.all.logincodeinput.style.display!='')document.all.codeimg.src='verifypic.asp';document.all.logincodeinput.style.display='';}//--></script><%ifSession("user")=""then%><formmethod="post"action="user/login.asp?action=login"onsubmit="returnCheckForm(this)"><tablealign="center"><tr><td>用户名:</td><td><inputtype="text"name="username"class="inputstyle"size="15"onFocus="showCodeimg()"></td></tr><tr><td>密 码:</td><td><inputtype="password"name="password"class="inputstyle"size="15"></td></tr><trid="logincodeinput"style="display:none"><td>验证码:</td><td><inputtype="text"class="inputstyle"name="code"size="5"><imgsrc="images/loading.gif"id="codeimg"width="56"height="20"align="absmiddle"></td></tr><tr><inputname="dl"type="hidden"value="1"><td> </td><tdheight="35"><inputtype="submit"value="登陆"style="width:110px;"class="bt1"></td></tr><tr><tdcolspan="2"align="center"><ahref="/user/reg.asp">注册新用户</a></td></tr></table></form><%else%><ulclass="l"><%setrs=server.CreateObject("adodb.recordset")rs.Open"select*from[dl_user]whereusername='"&Session("user")&"'",conn,1,3jine=rs("jine")viptime=rs("viptime")rs.Closesetrs=nothing%><li>欢迎您,<%=Session("user")%></li><%ifviptime>now()then%><li>帐户类型:VIP用户</li><%else%><li>帐户类型:普通用户<imgsrc='images/u.gif'align='absmiddle'><ahref='user/pay.asp'class='redfont'target='_blank'>升级</a></li><%endif%><li>可用资金:<%=jine%>元</li><li><ahref="/user/">进入控制中心</a></li><li><ahref="/user/out.asp">退出登陆</a></li></ul><%endif%></div><divid="fBottom"><ul><li></li></ul></div></div><divid="f2"><divid="fTitle"><ul><li>快速搜索</li></ul></div><divid="fMain"><formname="form2"method="post"action="index.asp">备案网站名称:<inputname="webname"class="inputstyle"size="10"><br>备案主办名称:<inputname="icpname"class="inputstyle"size="10"><center><inputtype="submit"value="搜索"class="bt1"></center></form><br><ulid="rList"><li><ahref=/index.asp?czm=2&ExtName=.com>纯字母com域名</a></li><li><ahref=/index.asp?czm=1&ExtName=.com>纯数字com域名</a></li><li><ahref=/index.asp?czm=2&ExtName=.cn>纯字母cn域名</a></li><li><ahref=/index.asp?czm=1&ExtName=.cn>纯数字cn域名</a></li></ul></div><divid="fBottom"><ul><li></li></ul></div></div><divid="f2"><divid="fTitle"><ul><li>使用帮助</li></ul></div><divid="fMain"><ulid="rList"><li>常见问题</li><li>使用帮助</li><li>预定说明</li><li><atarget="_blank"href="http://wpa.qq.com/msgrd?v=3&uin=2210792188&site=qq&menu=yes"><imgsrc="http://www.nicenic.com/images/c.gif"align="absmiddle"border="0">在线交谈</a></li><li></li></ul><ahref="http://www.22.cn/?source=26611"target="_blank"><imgsrc="http://www.22.cn/images/tuiguang/120x240.gif"border="0"></a></div><divid="fBottom"><ul><li></li></ul></div></div></td><!--右--></tr></table><br/></div><!--#includefile="end.asp"--><divstyle="color:#ffffff;position:absolute;top:-100px;left:-1000px;"></div></body></html>
解决方案四:
totalnumber和maxperpage有问题吧,要加个判断要是数据库为空,totalnumber和maxperpage都是0,0/0就出错了
解决方案五:
在相关的地方,显示相关的值,就应该知道的了。