?? daily_edi.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="function.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>無標題文檔</title>
</head>
<body><div align="center">
<script laguage="javascript">
<!--
function form1_onsubmit()
{
if (document.form1.dy_title.value=="")
{
alert("請輸入標題!")
document.form1.dy_title.focus()
return false
}
else if(document.form1.dy_content.value=="")
{
alert("請輸入日記內容!")
document.form1.dy_content.focus()
return false
}
}
-->
</script>
<% if request.Form("submit")="提交" then
dy_title=trim(request.form("dy_title"))
dy_content=trim(request.form("dy_content"))
id=cint(request.form("id"))
if dy_title="" or dy_content="" then
response.Write("日記標題和內容不可以為空!")
response.End()
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from dy_daily where dy_id="&id
rs.open sql,conn,3,3
rs("dy_name")=dy_title
rs("dy_content")=dy_content
rs.update%>
<script language="JavaScript">
alert("編輯成功!")
window.location.href("daily.asp")
</script>
<%
response.End()
end if
end if
%>
<%id=cint(request.QueryString("id"))
if id<>"" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from dy_daily where dy_id="&id
rs.open sql,conn,3,3%>
<form name="form1" method="post" action="daily_edi.asp" onsubmit="return form1_onsubmit()">
<table width="455" height="182" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr align="center" bgcolor="#009933">
<td height="23" colspan="2">日記修改</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="110" height="39" align="right">日記標題:</td>
<td width="342"><input name="dy_title" type="text" id="dy_title" size="25" value="<%=rs("dy_name")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right">日記內容:</td>
<td><textarea name="dy_content" cols="40" rows="8" id="dy_name"><%=covhtml(rs("dy_content"))%></textarea></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td colspan="2"><input type="submit" name="submit" value="提交">
<input type="reset" name="submit2" value="重置">
<input type="hidden" name="id" value="<%=id%>"></td>
</tr>
</table>
</form>
<%rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -