发新话题
打印

[已解] 急求发帖内容含HTML的解决办法

急求发帖内容含HTML的解决办法

弱弱的问一下
  日志内容含HTML的解决办法?好像zblog发的日志是支持HTML的 然后我下面的代码
一添加就看不到源代码了。如何解决

我看到很多BLOG
都这里的一样 http://www.wilf.cn/post/189.html
外面加个DIV还是什么 不知道怎么操作的?
请教路过的高手。

还有我的世界之窗在家里没法用可视编辑 在公司怎么又可以?同是THEWORLD版本也一样
<html>   
  <head>   
  <meta   http-equiv="Content-Type"   c>   
  <title>无标题文档</title>   
  <script   language="JavaScript">   
  function   ProductSn_onkeyup()   {   
      var   this_obj=eval('document.thisForm.CheckText')   
      var   CheckText=this_obj.value   
      var   valid_char='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'   
      for   (i=0;i<=CheckText.length;i++)   {   
          var   the_char=CheckText.charAt(i)   
          if(valid_char.indexOf(the_char)==-1){   
              alert('只能输入字母!')   
              this_obj.value=CheckText.substring(0,i)   
              return   1   
          }   
      }   
  }   
  </script>   
  </head>   
   
  <body>   
    <form   name="thisForm"   method="post"   action="RegInputBasInfo.asp">   
      <span   id="SnInput">   
      <input     name="CheckText"   id="CheckText"      size="10"   maxLength="10"   LANGUAGE="javascript">   
      </span>     
  </form>   
  </body>   
  </html>

[ 本帖最后由 camel2006 于 2007-7-30 12:44 编辑 ]

TOP

就像我发的主题一样
zblog能不能做到跟DISCUZ帖子内容一样 忽略掉HTML
如果生成HTML的时候 用
<%=server.HTMLEncode(rs("content") & "")%>
这样就不能跟DISCUZ那样 的 识别<a>标签?
不知道你们是怎么解决的??
我是昨天晚上才接触的zblog
是个彻头彻尾的新手。

TOP

UBB编辑有[code][/code]和[code_lite][/code_lite]标签
可视编辑器的话应该可以直接打。
[AD]:个人BLOG:思想碎片@Zx.MYS
[说明]:1.有事请发帖,论坛短消息已禁用。2.写Z-Blog程序的不是我,是另外一个zx。3:准备高考,消失一年。

TOP

可视编辑器的话应该可以直接打
打什么?
直接打HTML代码也能显示吗?
<html>   
  <head>   
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">   
  <title>无标题文档</title>   
  <script   language="JavaScript">   
  function   ProductSn_onkeyup()   {   
      var   this_obj=eval('document.thisForm.CheckText')   
      var   CheckText=this_obj.value   
      var   valid_char='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'   
      for   (i=0;i<=CheckText.length;i++)   {   
          var   the_char=CheckText.charAt(i)   
          if(valid_char.indexOf(the_char)==-1){   
              alert('只能输入字母!')   
              this_obj.value=CheckText.substring(0,i)   
              return   1   
          }   
      }   
  }   
  </script>   
  </head>   
   
  <body>   
    <form   name="thisForm"   method="post"   action="RegInputBasInfo.asp">   
      <span   id="SnInput">   
      <input     name="CheckText"   id="CheckText"   onkeyup="return   ProductSn_onkeyup()"   size="10"   maxLength="10"   LANGUAGE="javascript">   
      </span>     
  </form>   
  </body>   
  </html>

TOP

是啊。
[AD]:个人BLOG:思想碎片@Zx.MYS
[说明]:1.有事请发帖,论坛短消息已禁用。2.写Z-Blog程序的不是我,是另外一个zx。3:准备高考,消失一年。

TOP

别打到源代码里就行了。
[AD]:个人BLOG:思想碎片@Zx.MYS
[说明]:1.有事请发帖,论坛短消息已禁用。2.写Z-Blog程序的不是我,是另外一个zx。3:准备高考,消失一年。

TOP

谢谢Zx.MYS !!!
另外还有几个问题
1.7有没有现成的兼容各大浏览器的运行框

另我发这个日志的时候

获取中文字符串拼音首字母串的函数 与
替换指定文件内字符串的函数下的内容无法显示
我改动了下 连这篇日志都打不开了
asp自定义函数(一) 文档管理系统 V2.0
---------------------------------汉字判断-----------------------------------
function isChinese(para)
       on error resume next
       dim str
       dim i
       if isNUll(para) then
          isChinese=false
          exit function
       end if
       str=cstr(para)
       if trim(str)="" then
          isChinese=false
          exit function
       end if
       for i=1 to len(str)
     c=asc(mid(str,i,1))
             if c>=0 then
    isChinese=false
              exit function
           end if
       next
       isChinese=true
       if err.number<>0 then err.clear
   end function
%>
-----------------------替换指定文件内字符串的函数---------------------------

function FSOlineedit(filename,Target,String)
Dim objFSO,objCountFile,FiletempData
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)
FiletempData = objCountFile.ReadAll
objCountFile.Close
FiletempData=Replace(FiletempData,Target,String)
    Set objCountFile=objFSO.CreateTextFile(Server.MapPath(filename),True)
objCountFile.Write FiletempData
objCountFile.Close
Set objCountFile=Nothing
Set objFSO = Nothing
End Function
response.write FSOlineedit("test.txt","世界","明天")

--------------------获取中文字符串拼音首字母串的函数------------------------
<?
response.write "<#link href=style.css rel=stylesheet>"
if request.form("content")="" then
response.write "<center><#form method=post action=asd.asp><input name=content type=text>__<input type=submit></form>"
else
function getpychar(char)
tmp=65536+asc(char)
if(tmp>=45217 and tmp<=45252) then
getpychar= "A"
elseif(tmp>=45253 and tmp<=45760) then
getpychar= "B"
elseif(tmp>=45761 and tmp<=46317) then
getpychar= "C"
elseif(tmp>=46318 and tmp<=46825) then
getpychar= "D"
elseif(tmp>=46826 and tmp<=47009) then
getpychar= "E"
elseif(tmp>=47010 and tmp<=47296) then
getpychar= "F"
elseif(tmp>=47297 and tmp<=47613) then
getpychar= "G"
elseif(tmp>=47614 and tmp<=48118) then
getpychar= "H"
elseif(tmp>=48119 and tmp<=49061) then
getpychar= "J"
elseif(tmp>=49062 and tmp<=49323) then
getpychar= "K"
elseif(tmp>=49324 and tmp<=49895) then
getpychar= "L"
elseif(tmp>=49896 and tmp<=50370) then
getpychar= "M"
elseif(tmp>=50371 and tmp<=50613) then
getpychar= "N"
elseif(tmp>=50614 and tmp<=50621) then
getpychar= "O"
elseif(tmp>=50622 and tmp<=50905) then
getpychar= "P"
elseif(tmp>=50906 and tmp<=51386) then
getpychar= "Q"
elseif(tmp>=51387 and tmp<=51445) then
getpychar= "R"
elseif(tmp>=51446 and tmp<=52217) then
getpychar= "S"
elseif(tmp>=52218 and tmp<=52697) then
getpychar= "T"
elseif(tmp>=52698 and tmp<=52979) then
getpychar= "W"
elseif(tmp>=52980 and tmp<=53640) then
getpychar= "X"
elseif(tmp>=53689 and tmp<=54480) then
getpychar= "Y"
elseif(tmp>=54481 and tmp<=62289) then
getpychar= "Z"
else '如果不是中文,则不处理
getpychar=char
end if
end function
function getpy(str)
for i=1 to len(str)
getpy=getpy&getpychar(mid(str,i,1))
next
end function
content=request.form("content")
response.write "<center>"&getpy(content)&chr(10)
response.write "<br><br><br><a href=# onclick=javascript######:history.go(-1)>返回</a>"
end if
?>
----------------------------------------------------------------------------


---------------------------------ip限制函数---------------------------------
'Function CheckIp(cInput_Ip,cBound_Ip)
'Created by qqdao, qqdao@263.net 2001/11/28
'说明:首先需要根据;号循环,然后判断是否含有"-",如果有则进行拆分处理,最后判断是否在范围内
'参数: cInput_Ip,代检查的ip
' cBound_Ip,给定的范围格式为,单个ip,和范围ip,范围ip最后使用”-“分割,如果是“*”则必须放到最后一位
'                每个范围后添加":ALLOW"表示允许登陆,添加":REFUSE"表示拒绝登陆。多个范围用”;“隔开
'                 例如192.168.1*.*:ALLOW;192.168.1.1:ALLOW;192.168.1.1-10:REFUSE"
'返回值: true/false
'更新:2001/12/05  支持ALLOW,REFUSE支持’*‘,不想对?支持,因为和*差不多
'******************************
function CheckIp(cInput_Ip,cBound_Ip)
dim cSingle_Ip,cTemp_IP,cStart_IP,cEnd_Ip
CheckIp = false
cSingle_Ip=split(cBound_Ip,";")

        for i=0 to ubound(cSingle_Ip)
            if Instr(cSingle_Ip(i),"REFUSE") <> 0 then    '就是拒绝了
                 cTemp_IP = left(cSingle_Ip(i),instr(cSingle_Ip(i),":")-1)
           
      if Instr(cTemp_IP,"*") <> 0 then  '是宽范围
          cStart_IP = left(cTemp_IP,instr(cTemp_IP,"*")-1)
          if left(cInput_Ip,len(cStart_IP))=cStart_IP then
           CheckIp = false
           exit function
          end if
             end if

      if Instr(cTemp_IP,"-") = 0 then
   cStart_IP = cTemp_IP
   cEnd_Ip   = cTemp_IP
      else
   cStart_IP = left(cTemp_IP,instr(cTemp_IP,"-")-1)
   cEnd_Ip   = left(cStart_IP,InStrRev(cStart_IP,".")-1)+"."+mid(cTemp_IP,instr(cTemp_IP,"-")+1)
      end if

      if  Ip2Str(cInput_Ip)>=Ip2Str(cStart_IP) and Ip2Str(cInput_Ip)<=Ip2Str(cEnd_Ip) then
          CheckIp = false
          exit function
      end if

     elseif Instr(cSingle_Ip(i),"ALLOW") <> 0 then    '允许
           
                 cTemp_IP = left(cSingle_Ip(i),instr(cSingle_Ip(i),":")-1)
         
      if Instr(cTemp_IP,"*") <> 0 then          '是宽范围
          cStart_IP = left(cTemp_IP,instr(cTemp_IP,"*")-1)
          if left(cInput_Ip,len(cStart_IP))=cStart_IP then
           CheckIp = true
          end if
             end if

      if Instr(cTemp_IP,"-") = 0 then
   cStart_IP = cTemp_IP
   cEnd_Ip   = cTemp_IP
      else
   cStart_IP = left(cTemp_IP,instr(cTemp_IP,"-")-1)
   cEnd_Ip   = left(cStart_IP,InStrRev(cStart_IP,".")-1)+"."+mid(cTemp_IP,instr(cTemp_IP,"-")+1)
      end if

      if  Ip2Str(cInput_Ip)>=Ip2Str(cStart_IP) and Ip2Str(cInput_Ip)<=Ip2Str(cEnd_Ip) then
          CheckIp =true
      else
          CheckIp =false
      end if
     end if
       next

end function


'******************************
'Function Ip2Str(cIp)
'参考动网ip算法
'参数:cIp ip地址
'返回值: 转换后数值
'******************************
function Ip2Str(cIp)
Dim str1,str2,str3,str4
Dim cIp_Temp
if cIp="127.0.0.1" then cIp="192.168.0.1"
  str1=left(cIp,instr(cIp,".")-1)
  cIp_Temp=mid(cIp,instr(cIp,".")+1)
  str2=left(cIp_Temp,instr(cIp_Temp,".")-1)
  cIp_Temp=mid(cIp_Temp,instr(cIp_Temp,".")+1)
  str3=left(cIp_Temp,instr(cIp_Temp,".")-1)
  str4=mid(cIp_Temp,instr(cIp_Temp,".")+1)

if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then

else
         Ip2Str=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
end if

end function


'代码调用演示
if CheckIp("192.168.1.1","192.168.1.*:REFUSE") then
response.write "登陆成功"
else
response.write "您的ip不被允许"
end if

cinput_ip就是要检查的ip,也就是Request.ServerVariables("REMOTE_ADDR")
cbound_ip是范围,可以存到库里,范围的写法,我已详细说明了。

TOP

发新话题