www.gusucode.com > 盐城分类信息网asp源码程序 > x_sc.asp

    <!--#include file="inc/conn.asp"-->
<%
dim id,username,rs,sql
if request.cookies("cnmai")("username")="" or request.cookies("cnmai")("domain")="" or request.cookies("cnmai")("id")="" then 
response.write "<br>"
response.write "<li>你还没有登陆!"
cl
response.end
end if
id=trim(request("id"))
if id="" or not isnumeric(id) then
response.write "<li>参数错误!"
cl
response.end
end if
username=trim(request.cookies("cnmai")("username"))
set rs=server.createobject("adodb.recordset")
sql="select username,scid from shoucang where username='"&username&"' and scid='"&id&"' "
rs.open sql,conn,1,3
if (rs.eof or rs.bof) then
rs.addnew
rs("username")=username
rs("scid")=id
rs.update
response.write "<br>"
response.write "<li>收藏成功!"
cl
else
response.write "<br>"
response.write "<li>你已经收藏过了!"
cl
response.end
end if
rs.close
set rs=nothing
closedb
%>
<%sub cl()%>
<body onLoad="setTimeout(window.close, 2000)">
<%end sub%>