插入新闻时让系统认识"回车"与"空格"

<%
'用于从数据库中获取数据的sql语句
set rs=server.createobject("adodb.recordset")
dim str
str=request.Form("content")
str=replace(str," ","&加几个字好不让空格执行nbsp;")
str=replace(str,vbcrlf,"<br />")
sql="update notes set 内容='"&str&"' where id=2"
conn.Execute(sql)
%>

精华在于
str=replace(str," ","&加几个字好不让空格执行nbsp;")
str=replace(str,vbcrlf,"<br />")
//此代码的含义是替换为系统可识别的回车和空格
他在数据库操作以前把提交值做相应的替换处理
                        提供者:沙漠之狐


[本日志由 admin 于 2008-03-01 05:13 PM 编辑]
文章来自: 本站原创
引用通告地址: http://www.cn-sohu.com/bolg/trackback.asp?tbID=67
Tags:
评论: 0 | 引用: 320 | 查看次数: 653
发表评论
你没有权限发表留言!
分享到: