<!--#include file="chkinput.asp"-->
<!--#include file="conn.asp"-->
<% 
username=Request.Cookies("esung")("username")
password=Request.Cookies("esung")("password")
if username="" or password="" then
response.redirect"login.asp"
end if
 
linkname=trim(Replace(Request.Form("linkname"),vbcrlf," "))
url=request.form("url")
if linkname="" then
response.write"<script language='javascript'>alert('对不起，请填写完整信息')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if
	
if isempty(url) or url="" then
response.write"<script language='javascript'>alert('对不起，请填写完整信息')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if
  

username=Request.Cookies("esung")("username")
password=Request.Cookies("esung")("password")
set rs=server.createobject("adodb.recordset")
    sql="select * from member where username='" &username& "'  "
    rs.open sql,conn,1,1
    if  rs.eof then
response.write"<script language='javascript'>alert('用户名密码错误！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if
  if password<>rs("password") then
  response.write"<script language='javascript'>alert('用户名密码错误！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if

if rs("lock")=1 then
response.write"<script language='javascript'>alert('用户被锁定。不能发贴！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if

conn.execute("insert into link (linkname,url) values('"&linkname&"','"&url&"')")
session("lasttime")=Now()
response.write"<script language='javascript'>alert('信息提交成功！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"



%>

