📄 content_edit4.asp
字号:
<!--#include file="../../include/db.asp"-->
<!--#include file="../../include/admin_check.asp"-->
<!--#INCLUDE FILE="power.ASP"-->
<%
action=trim(request.querystring("action"))
Set conn = OpenOrGet_Database("sql_conn")
newsid=trim(Request("id"))
'得到项目列表
sql="select number,name from item_type where number='"&trim(request("type"))&"'"
Set itemRs=Open_rs(conn,sql)
if action="add" or action="modi" then
selectsql="select id from content where title='"&trim(request("title"))&"'"
set checkRs=open_rs(conn,selectsql)
if not (checkRs.eof and checkRs.bof) then
Response.Write "<script language=javascript>"
Response.Write "alert('有同名的记录,请重新操作');"
Response.Write "history.go(-1);"
Response.Write "</script>"
Response.End
end if
mytitle=transvalue(request("title"))
apply_name=session("username")
if len(request("type"))=1 then
depart_number="0"&request("type")
else
depart_number=request("type")
end if
apply_time=now
conn.execute "insert into content(title,user_name,type_id,content,date) values('"&mytitle&"','"&apply_name&"','"&depart_number&"','"&transvalue(trim(request("content")))&"','"&now&"')"
Response.Write "<script language=javascript>"
Response.Write "alert('操作成功!!');"
Response.Write "window.location.href='content4.asp?myjoke=1&type="&trim(request("type"))&"&act=search';"
Response.Write "</script>"
'Response.End
end if
booksql="select * from content where id='"&newsid&"'"
Set rs = Open_Rs(conn,booksql)
'rs.addnew
'rs.cancelupdate
rs.AddNew
%>
<html>
<head>
<title>深圳育才一小欢迎您!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/include/page.css" type="text/css">
</head>
<body >
<table width="1" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="753" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><!--#include file="../../include/admin_banner.inc"--></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%"> </td>
<td width="99%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="td1"> </td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="21%" valign="top"><!--#include file="../../include/admin_left.inc"--></td>
<td width="2%" valign="top"> </td>
<td width="77%" height=1 valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td background="/images/middle/m-bg.gif" width="70"><img src="/images/wzgl.gif"></td>
<td background="/images/middle/m-bg.gif" align="right"><img src="/images/middle/pacer1.gif" width="3" height="38"></td>
<td background="/images/middle/m-bg.gif" align="right" valign="middle" width="16"><a href=# onClick="more()"><img src="/images/middle/more.gif" width="16" height="16" border=0 alt="更多"></a></td>
<td background="/images/middle/m-bg.gif" align="right" width="8"><img src="/images/middle/pacer.gif" width="8" height="38"></td>
<td background="/images/middle/m-bg.gif" align="right" valign="middle" width="16"><a href=# onClick="help()"><img src="/images/middle/help.gif" width="16" height="16" border=0 alt="栏目帮助"></a></td>
<td width="6" align="right"><img src="/images/middle/M-r.gif" width="16" height="38"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bg-left" width="6"><img src="/images/left/l-l.gif" border=0></td>
<td class="newsborder" width="100%" >
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height="170" valign="top">
<table border=0 cellpadding=0 cellspacing=0 align="center" width="100%" height="100%">
<form name=dataform method=post action='<%=Request.ServerVariables("PATH_INFO")%>?action=add' >
<tr>
<td class=tdsmall noWrap bgcolor="#f0f0e8"><br>
<b>项目名:</b></td>
<td bgcolor="#f0f0e8" class="tdsmall"><br>
<% response.write itemRs("name") %>
<input type=hidden name="type" value="<%=trim(request("type"))%>">
</td>
</tr>
<tr>
<td class=tdsmall noWrap valign=top bgcolor="#f0f0e8"><br>
<b>标题:</b>
<br>
</td>
<td bgcolor="#f0f0e8" class="tdsmall">
<input name="title" type=text value='<%=rs("title")%>' style='HEIGHT: 22px; WIDTH: 150px' class='edline' maxlength="50" >
<br>
</td>
</tr>
<tr>
<td class=tdsmall noWrap valign=top bgcolor="#f0f0e8"><b><br>
链接:</b></td>
<td bgcolor="#f0f0e8" class="tdsmall">
<input name="content" type=text value='<%=rs("content")%>' style='HEIGHT: 22px; WIDTH: 150px' class='edline' maxlength="200" >(字数限制200,格式如:http://www.sahu.com)
<br>
<br>
<input type=hidden name=id value=<%=rs("id")%>>
</td>
</tr>
</form>
</table>
<p align="center"> </p>
</td>
</tr>
<tr>
<td height="20" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td width="50%" height="30">
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><img border=0 src="/images/left/s-l.gif"></td><td background="/images/left/s-bg.gif" class=button noWrap> <a href="javascript:checkform2();">提 交</a> </td>
<td><img border=0
src="/images/left/s-r.gif"></td>
<td width="20"></td>
<td><img border=0
src="/images/left/s-l.gif"></td>
<td background="/images/left/s-bg.gif"
class=button noWrap> <a href="content4.asp?type=<%=itemrs("number")%>">返 回</a> </td>
<td><img border=0
src="/images/left/s-r.gif"></td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td class="bg_right" width="6"><img src="/images/left/l-r.gif" border=0></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top" class="xxtz_bg">
<td width="6"><img src="/images/middle/m_left.gif" width="13" height="8"></td>
<td width="100%" align="right"></td>
<td align="right" width="6"><img src="/images/middle/m_right.gif" width="12" height="8"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="13"> </td>
</tr>
<tr>
<td><!--#include file="../../include/dot.inc"--></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<SCRIPT language=javascript>
<!--
function checkform()
{ var Checkblank = /^(\s*|(\ )|(\.))*$/;
if (Checkblank.test(form.username.value))
{
alert("用户名不能为空!");
return false;
}
if (Checkblank.test(form.userpass.value))
{
alert("密码不能为空!");
return false;
}
window.form.submit();
}
function checkform2()
{ var Checkblank = /^(\s*|(\ )|(\.))*$/;
if (Checkblank.test(dataform.title.value)){
alert("标题不能为空!");
return;
}
if(dataform.title.value.length>=100)
{
alert("标题的字数不能超过100!");
return false;
}
if(dataform.content.value.length>=200)
{
alert("链接的字数不能超过100!");
return false;
}
window.dataform.submit();
}
//-->
</SCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -