摘要:
教程:ASP+SQL Server制作留言板的完整小例子,写写关于SQL Server数据库的简单使用过程的教程,也算一个小总结!记录一些常用的方法,关键字,单词等,供以后查阅用!我们用ASP+SQL Server做个简单的留言板为例!关键字:
ASP SQL Server 留言板 正文:
哪个表
if table="Feedback" then
title=cstr(trim(request.form("title")))
content=cstr(trim(request.form("content")))
'trim去掉字符串前后的空格,cstr数据类型转为字符型
if title<>"" and content<>"" then
Conn.Execute "proc_insert_Feedback '"&title&"','"&content&"'"
else
response.write "<script>alert('所需数据为空,请填写')</script>"
response.write"<script>history.go(-1)</script>"
response.end
end if
elseif table="subFeedback" then
Feedback_ID=trim(request.form("feedback_ID"))
content=cstr(trim(request.form("content")))
if Feedback_ID<>"" and content<>"" then
Conn.Execute "proc_insert_subFeedback "&Feedback_ID&",'"&content&"'"
else
response.write "<script>alert('所需数据为空,请填写')</script>"
response.write"<script>history.go(-1)</script>"
end if
end if
response.redirect("List.asp")
%>
下载这四个ASP文件。
六、总结
好了,到这里这个简单的留言板就做完了。当然里面还有很多要改进的地方,比仿说列表页要分页。回复的内容太长的话,回复递进的效果就不明显。没有过滤html代码javascript代码。没有管理后台等等。不过如果你能做出这个留言板,只要再增强一下功能和安全,做出一个像样的留言板那应该是没问题的。(出处:www.lastidea.net)
[1][2][3][4]