|
|
|
| После обработки кода страницы посредством strip_tags остаются обломки скриптов:
form {width 700px} label {display block font-size 14px} textarea {width 700px height 100px border 2px solid #ccc padding3px color #555 font 14px Arial Helvetica sans-serif} form div {position relative margin 1em 0} #counter {position absolute right 0 top 130 font-size 18px font-weight bold color #FFD8B0}var speller = new Speller({ url quotquot lang quotruquot options SpellerIGNORE_URLS })function spellCheck() { spellercheck([ documentforms[0]otv ]) //documentform1submit()}function fnShowProps(obj objName){ var result = quotquot for (var i in obj) // обращение к свойствам объекта по индексу result += objName + quotquot + i + quot = quot + obj[i] + quot quot documentwrite(result)}onload = function (){ with (documentform1otv) if (windowaddEventListener) addEventListener ('input' mFUNC false) else attachEvent ('onpropertychange' mFUNC) mFUNC ()}function mFUNC (){ if(documentform1otvvaluelength lt 50) { documentgetElementById ('counter')stylecolor = '#FF0000' documentgetElementById ('submit1')disabled = true }else{ documentgetElementById ('counter')stylecolor = '#FFD8B0' documentgetElementById ('submit1')disabled = false }}
|
Как бы от них освободиься? | |
|
|
|
|
|
|
|
для: Владимир55
(30.07.2011 в 11:06)
| | Да, strip_tags() удаляет только тэги, оставляя весь текст внутри них без изменений, поэтому содержимое тэгов <style></style> и <script></script> лучше предварительно удалять при помощи регулярных выражений
<?php
$content = preg_replace("|<style[^>]*>.*?</style>|is", "", $content);
$content = preg_replace("|<script[^>]*>.*?</script>|is", "", $content);
?>
|
| |
|
|
|
|
|
|
|
для: cheops
(30.07.2011 в 11:15)
| | Спасибо!
Кстати, этот прием можно удачно использовать для удаления или замены текста внутри двух разных образцов, что иной раз тоже бывает полезно. | |
|
|
|