|
主题: 紧急求救!!
|
zfj3721
职务:普通成员
等级:1
金币:0.0
发贴:1
|
#12003/6/1 22:52:47
我做了一个网页,后台数据库用的是ACCESS,网上显示库里的MEMO字段时,段落格式都显示不出来,显示出来的是一大片乱七八糟的文字!真是糟透了,这几天我到处都找不到如何解决!急得我是眼冒金星呀!!请各位高手告诉我如何解决,先谢谢啦!
|
今晚在线
职务:普通成员
等级:3
金币:1.0
发贴:761
|
#22003/6/2 0:03:37
替换掉一些 Replace 空格,换行符 加入下面的代码到网页里,然后再输出变量是用
Response.Write HTML_TOL8(变量名) =================================
function HTML_TOL8(str) dim result dim l if isNULL(str) then htmlencode2="" exit function end if l=len(str) result="" dim i for i = 1 to l select case mid(str,i,1) case "<" result=result+"<" case ">" result=result+">"
case chr(13) result=result+" " case chr(34) result=result+""" case "&" result=result+"&" case chr(32) 'result=result+" " if i+1<=l and i-1>0 then if mid(str,i+1,1)=chr(32) or mid(str,i+1,1)=chr(9) or mid(str,i-1,1)=chr(32) or mid(str,i-1,1)=chr(9) then result=result+" " else result=result+" " end if else result=result+" " end if case chr(9) result=result+" " case else result=result+mid(str,i,1) end select next HTML_TOL8 = result end function
|
今晚在线
职务:普通成员
等级:3
金币:1.0
发贴:761
|
#32003/6/2 0:09:48
替换掉一些 Replace 空格,换行符 加入下面的代码到网页里,然后再输出变量是用
Response.Write HTML_TOL8(变量名) =================================
function HTML_TOL8(str) dim result dim l if isNULL(str) then htmlencode2="" exit function end if l=len(str) result="" dim i for i = 1 to l select case mid(str,i,1) case "<" result=result+"<" case ">" result=result+">"
case chr(13) result=result+" " case chr(34) result=result+""" case "&" result=result+"&" case chr(32) 'result=result+" " if i+1<=l and i-1>0 then if mid(str,i+1,1)=chr(32) or mid(str,i+1,1)=chr(9) or mid(str,i-1,1)=chr(32) or mid(str,i-1,1)=chr(9) then result=result+" " else result=result+" " end if else result=result+" " end if case chr(9) result=result+" " case else result=result+mid(str,i,1) end select next HTML_TOL8 = result end function
|
ryonick
职务:普通成员
等级:2
金币:1.0
发贴:317
|
#42003/6/2 9:54:03
function invert(str) invert=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13)," ")," "," ") end function
|