⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 savetxt.asp

📁 该资料包含大量网络开发的案例和源代码
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="char.asp"-->
<%
	dim rs,sql
	dim name
	dim content
	dim id
	dim qq
	dim email
	dim homepage
	dim founderr
	dim head
	dim T_Emot
	founerr=false
	if trim(request.form("name"))="" then
  		founderr=true
  		errmsg="<li>你没有填写你的名称。</li><li><a href=javascript:history.back(1)><font color=red>点这里返回更正错误!</font></a></li>"
	end if

	if trim(request.form("content"))="" then
  		founderr=true
  		errmsg=errmsg+"<li>你没有填写留言内容。</li><li><a href=javascript:history.back(1)><font color=red>点这里返回更正错误!</font></a></li>"
	end if
	if trim(request.form("email"))="" then
  		founderr=true
  		errmsg=errmsg+"<li>你没有填写的你电邮地址(EMAIL地址)</li><li><a href=javascript:history.back(1)><font color=red>点这里返回更正错误!</font></a></li>"
	end if
        
	if founderr=false then
		name=htmlencode(request.form("name"))
		Nkey=htmlencode(trim(request.form("key")))
		email=request.form("email")
		qq=request.form("qq")
		homepage=request.form("homepage")
                head=request.form("head")
                T_Emot=request.form("T_Emot")
		
		if request("htmlable")="yes" then
		content=htmlencode2(request("content"))
		else
		content=ubbcode(request.form("content"))
		end if

	set rs=server.createobject("adodb.recordset")
	if request("action")="add" then
		call newsoft()
	elseif request("action")="edit" then
		call editsoft()
	else
		founderr=true
		errmsg=errmsg+"<li>没有选定参数</li>"
	end if
sub newsoft()
	sql="select * from book where (id is null)" 
	rs.open sql,conn,1,3
	rs.addnew
	rs("name")=name
	rs("content")=content
	rs("email")=email
	rs("qq")=qq
	rs("homepage")=homepage
	rs("head")=head
	rs("T_Emot")=T_Emot
	rs("hits")=0
	rs("addtime")=date()
	rs.update
	id=rs("id")
end sub
sub editsoft()
	sql="select * from book where id="&request("id")
	rs.open sql,conn,1,3
	rs("name")=name
	rs("content")=content
	rs("email")=email
	rs("qq")=qq
	rs("head")=head
	if request.form("writer")<>"" then
		rs("writer")=trim(request.form("writer"))
	end if
	if request.form("writefrom")<>"" then
		rs("writefrom")=trim(request.form("writefrom"))
	end if
	rs.update
	id=rs("id")
end sub

	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>
<html>

<head>
<title></title>
<link rel="stylesheet" type="text/css" href="3.css">

<meta http-equiv=refresh content="1; url=default.asp">
<title>回复成功</title></head>

<body>
<p>&nbsp;</p><p align="center"><FONT size=2>Please Wait......</FONT></p>
<p align="center"><FONT size=2>回复成功!二秒钟后系统自动返回留言簿页面</FONT></p>
<%
else
 response.write "<b>由于以下的原因不能保存数据:</B>"
 response.write errmsg
end if
%>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -