回复:

三 我认为这是一种比较冒险的办法,就是再进行一次数据库的查询,如果数据库表内没有相同的值与之相同那么返回错误.

  sql = “SELECT NAME FROM Category where ID=“&ID
  set temp=conn.Execute(SQL)
  if temp.bof or temp.eof then
  response.Redirect(“index.asp“)
  else
  cat_name=temp(“name“)
  end if
  set temp=nothing

  ‘上面的是数据ID 的检测,下面则是正式的查询

  sql = “SELECT ID T_ID, NAME FROM Category where ID=“&ID&“ ORDER BY xh asc“
  rs.open sql,conn,1,1

  四,我自己常用的数据过滤脚本,专利,呵~

  id=replace(id,”’”,””)
  If len( request(“id”))〉8 then ‘ 为什么取长度上面程序中已经说明
  response.write ““
  response.end
  else

  If request(“id”)〈〉”” then ‘取不为空则是为了防止一些程序页中会出现空值情况,如果不在这里做判断,程序会校验出错.

  If IsNumeric(request(“id“))=False then ’ 风清扬修改 ID数据监控程式
  response.write ““
  response.end
  end if
  end if
  end if