<!--#include file="conn.asp"-->
<%
if session("uid")="" then
	response.Write "<script LANGUAGE='javascript'>alert('您没有登录，无法使用该功能！');history.go(-1);</script>"
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<%
mSql="select * from Favorites where UserID='"&Session("UID")&"' and ProductID='"&Trim(Request("ProductID"))&"'"
set mRs=conn.execute(mSql)
if (mRs.eof and mRs.bof) then
	mSql="Insert Into Favorites(UserID,ProductID) values('"&Session("UID")&"','"&Trim(Request("ProductID"))&"')"
	conn.execute(mSql)
%>
<script language="javascript">
	alert("收藏成功!");
	window.history.go(-1);
</script>
<%	
else
%>
<script language="javascript">
	alert("您已经收藏该商品信息,请勿重复收藏!");
	window.history.go(-1);
</script>
<%	
end if
%>
<script language="javascript">
	alert("Hello");
	window.history.go(-1);
</script>
</body>
</html>
