<!--#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 hits from news where id="&newsid,conn,3,1
if not rs.eof then
	num=rs(0)
else
	num=0
end if
rs.close
set rs=nothing
conn.execute("update news set hits=hits+1 where id="&newsid)
response.Write("document.getElementById('hits').innerHTML="""&num&""";")
call connclose()
%>