<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<!--#include file="usercookies.asp"-->
<!--#include file="foxx.asp"-->
<%
dim username,id,neirong,comname,dname
dim rs,sql
username=trim(request("username"))
id=trim(request("id"))
neirong=trim(request("neirong"))
comname=trim(request("comname"))
dname=trim(request("dname"))

if id="" or username="" then
response.Write "<script LANGUAGE='javascript'>alert('您的参数有误！或者您不是知道会员！');this.location.href='index.asp';</script>"
response.end
end if
if username=dname then
response.Write "<script LANGUAGE='javascript'>alert('不能自己回答自己的问题！');history.go(-1);</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [FOX_hf] where xxid="&id&" and username='"&username&"'"
rs.open sql,conn,1,3
if not rs.eof or not rs.bof then
  if trim(rs("username"))=username then
response.Write "<script LANGUAGE='javascript'>alert('此问题您已经回答过了！');history.go(-1);</script>"
 response.end
 end if
 else
rs.addnew
rs("username")=username
rs("xxid")=id
rs("neirong")=neirong
rs("comname")=comname
rs("hfsj")=now()
rs.update
end if
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from [FOX_xinxi] where id="&id&""
rs.open sql,conn,1,3
rs("hfcs")=rs("hfcs")+1
rs.update
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select zhidaojf from [FOX_user] where username='"&username&"'"
rs.open sql,conn,1,3
rs("zhidaojf")=rs("zhidaojf")+ddjf
rs.update
rs.close
set rs=nothing
response.Write "<script LANGUAGE='javascript'>alert('感谢您的参与！');this.location.href='index.asp';</script>"
	Response.Write"<meta http-equiv='refresh' content='180;URL=index.asp'>"
%>