如何把一篇文章存入数据库或文档后原文输入到网页上(急!在线等)
数据库中text类型能实现这个功能吗? 问题点数:100、回复次数:3Top
1 楼freezwy(网络自由人)回复于 2002-07-23 16:20:49 得分 100
使用如下的函数格式化后就可以了。
<%
function htmlencode2(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 chr(13)
result=result+"<br>"
case chr(34)
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
htmlencode2=result
end function
%>
Top
2 楼lv1(CODER不易做)回复于 2002-07-23 16:31:55 得分 0
是把输入文档格式化后存入数据库吗?如果是,数据库的类型是什么阿?多谢Top
3 楼lv1(CODER不易做)回复于 2002-07-23 17:02:41 得分 0
多谢了,可以,真是高手高手高高手,有没有QQ啊!加我啊,14518300
以后有事就直接找你了,给个邮箱也行啊Top
相关问题
- 如何将WORD文档存入数据库?(无内容)
- 急急急!!!!如何利用ASP将电子文档存入数据库
- word 文档中的文字上下标,在IE浏览器的解决办法,同时,存入数据库的为word里的原文字。问题描述见内容。
- 如何把文件(如WORD文档)存入数据库,用SQL语句怎么实现
- Word文档存入到Access数据库中的OLE对象字段中!在线等待!
- 请问:如何将Doc文档存入到Sql Server数据库Image字段中,并读取出来?
- 如何将存入数据库的word,excel,pdf文档直接在IE中打开
- 急需解决:将word文档存入数据库中后,如何再调用word打开显示?
- 还是文档拷贝问题,原文档中的RTF域怎么拷贝到另一数据库中的新文档中。
- 我想把文档的内容写如数据库 再把刚存入的数据读出到*.txt文档中 请问可行吗?




