以下程序想要实现 country 中的operator显示,我制作了一也页面显示所有的country , 然后
我点页面中的china转到下面这个页面,可为什么没有任何显示呢?
数据库如下;
=================
id  country operator
1   china    CMCC
2   india    airtel
==================
<!--#include file="conn.asp"-->
<html >
<head></head>
<% 
dim rs
dim sql
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select operator from info where country='"&request("country")&"'"
rs.open sql,conn,1,1
%>
<body><table width="200" border="1">
<% do while not rs.eof %>
  <tr>
    <td> <%=rs("Operator")%> </td>

  </tr>
   <% rs.movenext                 
 loop 
 rs.close
 conn.close                                           
   %>
</table>
<p>&nbsp; </p>
</body>
</html>

解决方案 »

  1.   

    "select operator from info where country='"&request("country")&"'"
    有没有取到值
      

  2.   

    测试request("country")是否为空格
      

  3.   


    按道理就是不一定喽,调试看看,如果没取到值,就检查下SQL语句。
      

  4.   

    1、你的页面有SQL注入的漏洞   过滤单引号(request("country"))
    2、你是怎么跳转到上边的页面的,post?还是 get  xxx.asp?country=china?
      

  5.   

    我先通过sql="select distinct country from Info  "显示所有的country
    然后通过点country链接到显示operator,没有get和post