有关文章发布系统输入数据库时如何排版啊?

sunrainnet 2001-07-26 02:00:41
现在正在做一个信息发布系统,通过网络把文章输入数据库的,但如果文章有多张图片而且排版复杂的要怎么处理啊?我们现在是排好版好再把HTML代码发入数据库的,有没有更好的方法啊,能否在在输入数据库时就可以插图片及排版(如决定图片放在那些文字下,是居中还是居左等)
...全文
71 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
freezwy 2001-07-26
  • 打赏
  • 举报
回复
给你个函数,但是对长的连续的英文字母无效。
<%
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
%>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧