注册 登录
编程论坛 ASP技术论坛

如何换行

幻想妖精 发布于 2008-03-21 12:26, 672 次点击
自己照教程做了个留言本,发现个问题,
怎么留言的都是在一行,如何换行,
谢谢各位了
1 回复
#2
linjianhai2008-03-21 13:22
看一下你的表格有没有设置宽度。
或者你测试留言的时候用的留的都是同一个数字或者字母。这样就把表格组撑开了。。
或者你强制换行一下。
<%
function codetohtml(str)
if not isnull(str) then
    str = replace(str, ">", "&gt;")
    str = replace(str, "<", "&lt;")
    str= Replace(str, CHR(32), "&nbsp;")
    str= Replace(str, CHR(9), "&nbsp;")
    str= Replace(str, CHR(34), "&quot;")
    str= Replace(str, CHR(39), "'")
    str= Replace(str, CHR(13), "")
    str= Replace(str, CHR(10) & CHR(10), "</P><P> ")
    str= Replace(str, CHR(10), "<BR> ")
    codetohtml = str
end if
end function
%>
下面是你要显示留言内容的地方
<%
content=rs("content")
content=codetohtml(content)
response.write(content)
%>
1