html 코드(tag) 치환 > 기술자료

본문 바로가기

사이트 내 전체검색

html 코드(tag) 치환 > 기술자료

ClassicASP html 코드(tag) 치환

페이지 정보


본문

tag 못쓰게 하는 법

[ 방법.1 ]

<%
function ReplaceTag2Text(str)
   Dim text
      text = replace(str, "&", "&amp;")
      text = replace(text, "<", "&lt;")
      text = replace(text, ">", "&gt;")
      text = replace(text, "'", "&quot;")
      text = replace(text, """", "&quot;")
      ReplaceTag2Text = text
End Function

p_idx    = Request.QueryString("p_idx")
name    = upload.item("name")
titles     = upload.item("titles")
content = replace(upload.item("MinBoardContents"),"'","''")
ip         = request.servervariables("remote_host")

' 테그방지를 위한 변수교환
p_idx    = replaceTag2text(p_idx)
name    = replaceTag2text(name)
titles     = replaceTag2text(titles)

%>



[ 방법.2 ]
<%
' =========================================================
' html 코드 치환
' =========================================================
Function NullFillWith(src , data )
  if isNULL(src) or src = "" then
    if Not isNull(data) or data = "" then
      NullFillWith = data
    else
      NullFillWith = 0
    end if
  else
    If Not IsNumeric(src) then
      NullFillWith = Replace(src, "'", "''")
      NullFillWith = Replace(src, chr(34), "&#34")
      NullFillWith = Replace(src, chr(38), "&amp")
      NullFillWith = Replace(src, ";" , "&#59")
      NullFillWith = Replace(src, "<" , "&#60")
      NullFillWith = Replace(src, "--" , "&#45&#45")
      NullFillWith = trim(Replace(src, "..\" , "&#46&#46&#92"))
    else
      NullFillWith = src
    End if  
  end if
End Function

Function vReplace_IN(data)
  If Not IsNull(data) Then
    data  = Replace(data, "'" , "''")
    data  = Replace(data, chr(38), "&amp")
    data  = Replace(data, chr(34), "&#34")
    data  = Replace(data, ";" , "&#59")
    data  = Replace(data, "<" , "&#60")
    data  = Replace(data, "--" , "&#45&#45")
    data  = Replace(data , chr(13), "<br />" )
    data  = Trim(Replace(data, "..\" , "&#46&#46&#92"))
  End If
  vReplace_IN = data
End Function

Function vReplace_OUT(data)
  If Not IsNull(data) Then
    data  = Replace(data, "''", "'")
    data  = Replace(data, "&amp", chr(38))
    data  = Replace(data, "&#34", chr(34))
    data  = Replace(data, "&#59", ";")
    data  = Replace(data, "&#60", "<")
    data  = Replace(data, "&#45&#45", "--")
    data  = Replace(data , "<br>", chr(13))
    data  = Replace(data , "<br />", chr(13))
    data  = Trim(Replace(data, "&#46&#46&#92", "..\"))
  End If
  vReplace_OUT = data
End Function
%>

댓글목록

등록된 댓글이 없습니다.


Total 2,637건 108 페이지
  • RSS
기술자료 목록
열람
ClassicASP   12918  2008-06-10 19:47 ~ 2009-10-26 00:00  
496
영카트   15989  2008-06-09 11:02  
495
HTML   13504  2008-06-08 07:25 ~ 2010-12-06 00:00  
494
영카트   13777  2008-06-07 18:08  
493
일반   12214  2008-06-05 05:06  
492
JavaScript   25464  2008-06-04 12:18  
491
ClassicASP   15771  2008-05-29 22:14  
490
WindowsServer   22892  2008-05-29 17:51 ~ 2015-02-23 00:00  
489
테크노트   15179  2008-05-27 10:19 ~ 2022-10-13 07:40  
488
ClassicASP   15875  2008-05-23 23:29  
487
ClassicASP   22441  2008-05-23 23:14 ~ 2016-01-23 00:00  
486
MSSQL   25463  2008-05-22 05:48 ~ 2016-05-28 00:00  
485
ClassicASP   10420  2008-05-20 19:10  
484
Linux   9826  2008-05-20 08:10 ~ 2021-09-09 09:29  
483
메이크샵   14862  2008-05-03 11:28  
482
JavaScript   14124  2008-05-15 21:00  
481
도메인   13197  2008-05-15 14:14  
480
그누보드   11739  2008-05-10 15:38  
479
ClassicASP   26344  2008-05-04 09:58  
478
HTML   21234  2008-05-04 09:39  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2025 해피정닷컴. All Rights Reserved.