订联程机票:帮改下网页代码!

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/09 19:24:44
代码如下:我现在想一点下载链接就直接可下载,但现在却出现没有登陆。高手帮我改下。

<%

dim founderr,errmsg
errmsg=""
founderr=false
call chkparam()
if founderr then
call diserror()
response.end
else
if guestsoft="yes" then

softdowncount
call geturl()
else
if session("userlogin")<>"" then
softdowncount
call geturl()
else
Response.Write ("<script>alert(' 错误!\n\n您还没有登陆或登陆超时,请先登陆。');javascript:window.close();</script>")
Response.end
end if
end if

end if

sub chkparam()
if request.querystring("soft_id")<>"" then
if not isInteger(request.querystring("soft_id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的文件ID参数。"
end if
else
founderr=true
errmsg=errmsg+"<br>"+"<li>你没有指定要下载的文件。"
end if
if request.querystring("url")<>"" then
if not isInteger(request.querystring("url")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的下载地址参数。"
end if
else
founderr=true
errmsg=errmsg+"<br>"+"<li>你没有指定下载地址参数。"
end if
end sub

sub geturl()
if(request.querystring("soft_id") <> "") then
colname = request.querystring("soft_id")
end if
url="soft_url"+request("url")
sql="select "&url&" from soft where soft_id="&colname&""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
downurl=rs(0)
response.redirect downurl
rs.close
set rs=nothing
end sub

function softdowncount()
if(request.querystring("soft_id") <> "") then
upddcount__colname = request.querystring("soft_id")
end if
set rs=conn.execute("select soft_id,soft_dcount from soft")
sql="UPDATE soft SET soft_dcount = soft_dcount + 1 WHERE soft_id = " + Replace(upddcount__colname, "'", "''") + ""
conn.execute (sql)
rs.close
set rs=nothing
end function
%>

可以将中间验证session和验证会员软件或普通软件的信息去掉,即普通浏览者即可下载全部的软件,不需要登陆。

<%

dim founderr,errmsg
errmsg=""
founderr=false
call chkparam()
if founderr then
call diserror()
response.end
else

softdowncount
call geturl()

end if

sub chkparam()
if request.querystring("soft_id")<>"" then
if not isInteger(request.querystring("soft_id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的文件ID参数。"
end if
else
founderr=true
errmsg=errmsg+"<br>"+"<li>你没有指定要下载的文件。"
end if
if request.querystring("url")<>"" then
if not isInteger(request.querystring("url")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的下载地址参数。"
end if
else
founderr=true
errmsg=errmsg+"<br>"+"<li>你没有指定下载地址参数。"
end if
end sub

sub geturl()
if(request.querystring("soft_id") <> "") then
colname = request.querystring("soft_id")
end if
url="soft_url"+request("url")
sql="select "&url&" from soft where soft_id="&colname&""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
downurl=rs(0)
response.redirect downurl
rs.close
set rs=nothing
end sub

function softdowncount()
if(request.querystring("soft_id") <> "") then
upddcount__colname = request.querystring("soft_id")
end if
set rs=conn.execute("select soft_id,soft_dcount from soft")
sql="UPDATE soft SET soft_dcount = soft_dcount + 1 WHERE soft_id = " + Replace(upddcount__colname, "'", "''") + ""
conn.execute (sql)
rs.close
set rs=nothing
end function
%>

<%

dim founderr,errmsg
errmsg=""
founderr=false
call chkparam()
if founderr then
call diserror()
response.end
else

softdowncount
call geturl()

end if

sub chkparam()
if request.querystring("soft_id")<>"" then
if not isInteger(request.querystring("soft_id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的文件ID参数。"
end if
else
founderr=true
errmsg=errmsg+"<br>"+"<li>你没有指定要下载的文件。"
end if
if request.querystring("url")<>"" then
if not isInteger(request.querystring("url")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的下载地址参数。"
end if
else
founderr=true
errmsg=errmsg+"<br>"+"<li>你没有指定下载地址参数。"
end if
end sub

sub geturl()
if(request.querystring("soft_id") <> "") then
colname = request.querystring("soft_id")
end if
url="soft_url"+request("url")
sql="select "&url&" from soft where soft_id="&colname&""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
downurl=rs(0)
response.redirect downurl
rs.close
set rs=nothing
end sub

function softdowncount()
if(request.querystring("soft_id") <> "") then
upddcount__colname = request.querystring("soft_id")
end if
set rs=conn.execute("select soft_id,soft_dcount from soft")
sql="UPDATE soft SET soft_dcount = soft_dcount + 1 WHERE soft_id = " + Replace(upddcount__colname, "'", "''") + ""
conn.execute (sql)
rs.close
set rs=nothing
end function
%>