分享

写回答

发帖

[提问] 网页 出现错误 乱码 请帮忙,谢谢

GoDaddy GoDaddy 1034 人阅读 | 2 人回复

发表于 2010-10-15 13:47:57 | 显示全部楼层 |阅读模式

网页 出现错误 乱码 请帮忙,谢谢
http://www.optequipment.com/


到底是怎么回事? 怎么才能解决,谢谢。
我不懂语言,别人帮做的网站。

看有没有我自己能解决的方法,谢谢。

错误页面。

错误页面。

回答|共 2 个

stevensk

发表于 2010-10-15 13:50:21 | 显示全部楼层

这是你网站程序问题!

add.c

发表于 2010-10-15 13:51:12 | 显示全部楼层

问题太多了
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% response.buffer = true dim startTime, endtime startTime = timer() dim conn dim connstr dim rs, rSub dim sql connstr = "driver={microsoft Access driver (*.mdb)}; dbq=" & server.mappath("data/#data.mdb") set conn = server.createobject("ADODB.CONNECTION") if err.number<>0 then err.clear set conn=nothing response.write "" response.end else conn.open connstr if err.number<>0 then err.clear set conn=nothing response.write "" '''请检查数据库是否存在,以及 ODBC 是否存在 response.end end if end if set rs = Server.CreateObject("ADODB.Recordset") '主程序用 set rSub = Server.CreateObject("ADODB.Recordset") '子程序用 '+++++++++++++++++++++++++++++++上面这段为用户登录后要记录的COOKIES+++++++++++++++++++++++++++ Sub objend() set rSub=nothing set rs=nothing conn.close set conn=nothing endtime=timer() response.write "" End Sub '函数功能:获取网站指定属性 Function GetKey(strKeyName,strUserID,strType) strTemp=Eval(strType & "_" & strKeyName) if strTemp="" then GetKey="Null" else GetKey=strTemp end if End Function '获取文件所在的用户名称 Function GetUserName() 'Get CurrFolder Name,too The user name CurrPath=Server.MapPath( "../") pt=InStrRev(CurrPath,"") CurrFolder=Right(CurrPath,len(CurrPath)-pt) GetUserName=CurrFolder End Function '检查用户权限 sub checkuser(limitnum) if Session("UserFolder")<>WebUserName then response.Redirect("/Error.asp?msg=对不起,您无权访问这个页面,有问题请与管理员联系!") : userlimits=trim(Session("AdminLimit")) lp=instr(userlimits,limitnum) if lp<=0 then response.Redirect("/Error.asp?msg=对不起,您无权访问这个页面,有问题请与管理员联系!") response.end end if end sub '提示系统信息 sub ShowMsg(msg) msg=server.URLEncode(msg) '将字符串编码,以便做参数传递 response.Redirect("/error.asp?msg=" + msg) end sub '判断访问来源,如果不是本部则无法访问 sub checkPrePage() url=request.ServerVariables("HTTP_REFERER") url=trim(replace(url,"http://","")) url=trim(left(url,len(request.ServerVariables("SERVER_NAME")))) if url<>trim(request.ServerVariables("server_name")) then ShowMsg "严重警告:非法访问!
  2. 以任何方式攻击、影响本站的正常运转都是一种犯法的行为,都将承担法律责任!" response.End() end if end sub '===========================专门用来过滤Request的参数值=================================== function GetVariable(strVariableName) if IsEmpty(Request(strVariableName)) then GetVariable=empty exit Function end if GetVariable=Replace(Request(strVariableName),"'","''") GetVariable=Replace(GetVariable,";","") GetVariable=Replace(GetVariable,"--","") end function function GetFormVariable(strVariableName) if IsEmpty(Request.Form(strVariableName)) then GetFormVariable=empty exit Function end if GetFormVariable=Replace(Request.Form(strVariableName),"'","''") GetFormVariable=Replace(GetFormVariable,"--","") end function function GetQueryString(strVariableName) if IsEmpty(Request.QueryString(strVariableName)) then GetQueryString=empty exit Function end if GetQueryString=Replace(Request.QueryString(strVariableName),"'","''") GetQueryString=Replace(GetQueryString,";","") GetQueryString=Replace(GetQueryString,"--","") end function '===========================专门用来过滤Request的参数值=================================== '寻找第一个栏目ID号 function FirstMenu() FirstMenu=0 End function '添加会员日记 Sub LogIn(strMID,strEvent) strSQL="Insert Into web_log(m_id,l_event,l_time) Values(" & strMID & ",'" & strEvent & "','"&now()&"')" conn.execute strSQL End sub '检查会员权限 '参数:strSymbol-权限代号,栏目的代号是该栏目的ID,在线购物为sp,新闻内容为new等 Sub ChkMember(strSymbol) '检查访问者 if Session("m_Code")="" then strForVisitor=GetKey("Visitor",WebUserID,"member") if Instr(strForVisitor,strSymbol)>0 then '此页面已经被加密,拒绝访问者 ShowMsg "拒绝访问!

  3. 您不是会员或者尚未登录,[注册会员][登 录]" end if end if '检查普通会员 if Session("m_Code")="0" then strForMember=GetKey("Member",WebUserID,"member") if Instr(strForMember,strSymbol)>0 then '此页面已经被加密,拒绝访问者 ShowMsg "拒绝访问!

  4. 您不是VIP会员或者尚未登录,[升级VIP会员][登 录]" end if end if End sub Function CutStr(Str,Gtype,lennum) Dim p_num Dim i,x If strlen(Str)<=lennum Then CutStr=str Else p_num=0 x=0 Do while not p_num > lennum-2 x=x+1 If asc(mid(str,x,1))<0 Then p_num=int(p_num) + 2 Else p_num=int(p_num) + 1 End If If Gtype = 1 Then CutStr=left(trim(str),x) & "..." Else CutStr="..." & Right(trim(str),x) End IF Loop End If End Function '取字符串长度 Function strlen(str) Dim p_len,xx p_len=0 strlen=0 If trim(str)<>"" Then p_len=len(trim(str)) For xx=1 to p_len If asc(mid(str,xx,1))<0 Then strlen=clng(strlen) + 2 Else strlen=clng(strlen) + 1 End If Next End If End Function %> <% strCurrMenu="176" ThisPage=request.ServerVariables("URL") strClassName=GetVariable("classname") if strClassName="" then strClassName="所有产品" end if strQuery="" strClass=GetVariable("class") if strClass<>"" then SourCode=conn.execute("Select c_code From web_product_class Where mn_id=" & strCurrMenu & " and id="&strClass)(0) strQuery=strQuery & " And c_code Like '" & SourCode &"%'" end if strKey=GetVariable("key") if strKey<>"" then strQuery=strQuery & " And (p_name Like '%" & strKey & "%' Or p_detail Like '%" & strKey & "%') " strClassName="搜索:" & strKey end if strPrice1=GetVariable("price1") if strPrice1<>"" then strQuery=strQuery & " And p_price>=" & strPrice1 strClassName=strClassName & "  最低价格" & strPrice1 end if strPrice2=GetVariable("price2") if strPrice2<>"" then strQuery=strQuery & " And p_price<=" & strPrice2 strClassName=strClassName & "  最高价格" & strPrice1 end if %> <% '读取产品展示的属性,以确定显示那个字段 showClass=GetKey("showClass",WebUserID,"product_" & strCurrMenu ) showPrice=GetKey("showPrice",WebUserID,"product_" & strCurrMenu ) showSize=GetKey("showSize",WebUserID,"product_" & strCurrMenu ) showSymbol=GetKey("showSymbol",WebUserID,"product_" & strCurrMenu ) showFace=GetKey("showFace",WebUserID,"product_" & strCurrMenu ) showShop=GetKey("showShop",WebUserID,"product_" & strCurrMenu ) showDetail=GetKey("showDetail",WebUserID,"product_" & strCurrMenu ) %> <% strSQL="Select * From v_web_product Where mn_id=" & strCurrMenu & strQuery & " Order by p_code,ID Desc" Set rs=Server.CreateObject("ADODB.RecordSet") rs.open strSQL,conn,1,1 '分页显示初始化 page=GetVariable("page") if page="" then page=1 else page=Cint(page) end if Section=GetVariable("section") if Section="" then Section=1 else Section=Cint(Section) end if '变量赋值 intPageSize=16 '每页显示记录数 intSectionSize=5 ''多少页为一段,像GOOGLE一样 PrevSectionText="7" '上一段的链接文字 NextSectionText="8" '下一段的链接文字 PrevPageText="3" '上页的链接文字 NextPageText="4" '下页的链接文字 strPageUrl="?class=" & GetVariable("class") & "&key=" & GetVariable("key") & "&price1=" & GetVariable("price1") & "&price2=" & GetVariable("price2") rs.pagesize=intPageSize intCount=rs.RecordCount intPageCount=rs.pagecount intSectionCount=(intPageCount - 1) \ intSectionSize + 1 if intCount>0 then rs.AbsolutePage=page end if %>
  5.         Bench / function counter / Ventilation Series / clean Series          
  6. Home | Favorites | Contact | chinase          
  7. Home         |         About         |         News         |         Products         |         Jobs         |         Feedback         |         Contact
  8. <% '开始输出分类 strcode="" for i=1 to Len(SourCode) \ 4 strcode=strcode&" or c_code like '"&left(SourCode,i*4)&"____'" next if strcode<>"" then strcode="(1<>1"&strcode&" or Len(c_code)=4)" else strcode=" Len(c_code)=4" end if strSQL="Select * From web_product_class Where mn_id=" & strCurrMenu&" and " & strcode & " Order by c_code" 'response.Write(strsql) Set rsclass=Server.CreateObject("ADODB.RecordSet") rsclass.open strSQL,conn,1,1 for i=1 to rsclass.recordcount Level=(Len(rsclass("c_code"))/4-1)*3 %> <% rsclass.movenext next %>
  9.       <% If Len(rsclass("c_code"))>4 Then Response.Write "├" Response.Write String(Level,"-") %> &classname=<%=trim(rsclass("c_name"))%>"><%=trim(rsclass("c_name"))%>
  10. 客户服务

  11. HK OPT EQUIPMENT CORP LTD

  12. HK
  13. Add:
  14. Sales:
  15. Phone:
  16. Fax:
  17. Email:

  18. SHENZHEN
  19. Add:
  20. Sales:
  21. Phone:
  22. Fax:
  23. Email:
  24.        
  25. Abouts

  26. HK OPT EQUIPMENT CORP LTD provides selling, buying and renting services of second hand test equipment.

  27. Our equipments include brand like Agilent/HP, Advantest, Ando, Anritsu, Boonton, Fluke, Gigatronic, Hitachi, Keithley, Kenwood, Leader, Lecroy, Marconi, Panasonic, R&S, Tektronix, Wavetek, Willtron, Willtek, Yokogawa etc.

  28. We carry product like AC/DC Power Supply, DMM, HV Meter, Hypo Tester, Oscilloscope, LCR Meter, Logic Analyzer, Mobile Commuciation, Modem Tester, Network Analyzer, Pattern Generator, Power Supplies (Ampiifier/Meter), Spectrum Analyser, Signal Generator, Telephone Network Analyzer, Meters, Universal Counters, Wireless and optical test equipments.
  29.                                                   more....

  30. Products
  31. <% '循环输出 for i=1 to (intPageSize + 1) \ 4 if rs.eof then exit for %> <% for j=1 to 4 if rs.eof then exit For %> <% rs.movenext next %>
  32. <%if showClass<>"none" then %> <%end if%> <%if showSymbol<>"none" then %> <%end if%> <%if showFace<>"none" And showFace<>"Null" then %> <%end if%> <%if showSize<>"none" then %> <%end if%> <%if showPrice<>"none" then %> <%end if%> <%if showShop<>"none" then %> <%end if%>
  33. &mnid=<%=strCurrMenu%>&classname=公司产品&uppage=<%=ThisPage%>" target="_blank">" alt="w" width="146" height="140" border="0" />
  34. <%if showDetail<>"none" then %> &mnid=<%=strCurrMenu%>&classname=公司产品&uppage=<%=ThisPage%>" target="_blank"><%=trim(rs("p_name"))%> <%else%> <%=trim(rs("p_name"))%> <%end if%>
  35. <% next %>
  36. Tel : Fax : Website: E-MAIL:
  37. © 2010 HK OPT EQUIPMENT CORP LTD CopyRight
  38. Main Products: bench / function counter / Ventilation Series / clean Series / Teaching Equipment Series
复制代码
RAKSmart
您需要登录后才可以回帖 登录 | 注册

本版积分规则