原为.asp?=474 如何更改.asp直接从资料库抓474值

来源:百度知道 编辑:UC知道 时间:2024/06/14 20:26:39
原本需要点击.asp?=474才能抓到数值...如何改成直接点击.asp就能叫出474值? 整串都用474值套用
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<%dim id
id=request.QueryString("id")
if not isnumeric(id) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(id) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
set rs_shjia=server.CreateObject("adodb.recordset")
strshjia="select * from shjia where shjiaid="&id
rs_shjia.open strshjia,conn,1,1
if rs_shjia.bof and rs_shjia.eof then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else

在你的代码的第三行和第四行间插入这句话就行了。
if request.querystring("id")=0 then
id=474
end if

<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<%dim id
id=474
if not isnumeric(id) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(id) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
set rs_shjia=server.CreateObject("adodb.recordset")
strshjia="select * from shjia where shjiaid="&id
rs_shjia.open strshjia,conn,1,1
if rs_shjia.bof and rs_shjia.eof then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</sc