허용 테그 외 모든 태그 제거 > ASP

본문 바로가기




WEBDEV


사이트 내 전체검색


허용 테그 외 모든 태그 제거

페이지 정보

작성자 최고관리자 댓글 0건 조회 2,562회 작성일 18-04-02 16:52

본문

 Function strip_tags2(str,allowtags)
   Dim content, tags
   content = str
   tags = replace(allowtags,",","|")
   content = eregi_replace("<(/?)(?!/|" & tags & ")([^<>]*)?>","",content)
   content = eregi_replace("(javascript|vbscript)+","$1//",content)
   content = eregi_replace("(.location|location.|onload=|.cookie|alert|window.open|onmouse|onkey|onclick|view-source)+","//",content) '//자바스크립트 실행방지
  strip_tags2 = content
 End Function


str=내용

allowtags=허용태그   컴마로 구분 p,a,table

strip_tags2(str,allowtags)

댓글목록

등록된 댓글이 없습니다.



개인정보처리방침
서비스이용약관
모바일버전
그누보드5
Copyright © 소유하신 도메인. All rights reserved.