<%@ LANGUAGE=VBScript CodePage=65001%>
<% response.charset="utf-8" %>
<% session.codepage=65001 %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--#include file="../LyricInc/access.asp"  -->
<!-- #include file="LyricInc/functions.asp" -->
<!-- #include file="../LyricInc/x_to_html/index_to_html.asp" -->
<% '添加数据到数据表
page=request.querystring("page")
act=request.querystring("act")
keywords=request.querystring("keywords")
article_id=cint(request.querystring("id"))


act1=Request("act1")
If act1="save" Then 
l_id=trim(request.form("l_id"))
l_name=trim(request.form("name"))
l_url=trim(request.form("url"))
l_memo=trim(request.form("memo"))
l_time=now()
set rs=server.createobject("adodb.recordset")
sql="select id from web_keywords where [name]='"&l_name&"' and id<>"&l_id&""
rs.open(sql),cn,1,3
if not rs.eof then
response.Write "<script language='javascript'>alert('该关键词已经存在！');history.go(-1);</script>"
response.End()
else
rs.close 
set rs=nothing

set rs=server.createobject("adodb.recordset")
sql="select * from web_keywords where id="&l_id&""
rs.open(sql),cn,1,3
rs("name")=l_name
rs("url")=l_url
rs("memo")=l_memo
rs.update
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('提交成功！');location.href='keywords_list.asp?page="&page&"&act="&act&"&keywords="&keywords&"';</script>"
end if
end if 
 %>
 

	<%
Call header()

%>
<% set rs=server.createobject("adodb.recordset")
sql="select * from web_keywords where id="&article_id&""
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then%>
  <form id="form1" name="form1" method="post" action="?act1=save&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>">
         <script language='javascript'>
function checksignup1() {
if ( document.form1.name.value == '' ) {
window.alert('请输入名称^_^');
document.form1.name.focus();
return false;}

return true;}
</script>
	<table cellpadding='3' cellspacing='0' border='0' class='tableBorder' align=center>
	<tr>
	  <th class='tableHeaderText' colspan=2 height=25>修改关键词</th>
	<tr>
	<td width="15%" height=23 class='forumRow'>名称</td>
	<td width="85%" class='forumRow'><input name='name' type='text' id='name'  value="<%=rs("name")%>" size='80'>
	 <input name='l_id' type='hidden' id='l_id' value="<%=rs("id")%>" size='70'>
	  &nbsp;</td>
	</tr>
	<tr>
	<td width="15%" height=23 class='forumRowHighLight'>链接</td>
	<td width="85%" class='forumRowHighLight'><input name='url' type='text' id='url' size='80' value="<%=rs("url")%>" maxlength="200">
	  &nbsp;</td>
	</tr>	<tr>
	  <td class='forumRow' height=11>备注</td>
	  <td class='forumRow'><textarea name='memo'  cols="100" rows="3" id="memo" ><%=rs("memo")%></textarea></td>
	</tr>
	<tr><td height="100" colspan=2  class='forumRow2'><div class='ButtonFix' align="center">
	  <INPUT class='GPetSubmit' type=submit value='提 交'  onClick='javascript:return checksignup1()' name=Submit>
	  </div></td></tr>
	</table>
</form>
<%
else
response.write"未找到数据"
end if%>
<%
Call DbconnEnd()
 %>