<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/dsql.asp"-->
<%
dim newsid,catalogid,num,userip

if not isempty(request.QueryString("newsid")) then
	newsid=Clng(trim(request.QueryString("newsid")))
else
	response.Write("error")
	response.End()
end if
if not isempty(request.QueryString("catalogid")) then
	catalogid=Clng(trim(request.QueryString("catalogid")))
else
	response.Write("error")
	response.End()
end if
If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = Empty Then
	userip = Request.ServerVariables("REMOTE_ADDR")
Else
	userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
End If
Set rs = Server.CreateObject("Adodb.RecordSet")				 
rs.Open "Select * from news_count where articleid="&newsid,conn,3,3
if rs.eof or rs.bof then
	num=1
	rs.addnew
	rs("count")=num
	rs("articleid")=newsid	
	rs("newstype")=catalogid
	rs.update	
else
	num=rs("count")
	rs("count")=num+1
	rs.update	
end if
rs.close
set rs=nothing
response.Write("document.write("""&num&""");")
call connclose()
%>