|
|
|
| Нужен такой скрипт с htmlspecialchars()...
Обычный перевод текста в что-то типа такого:
<a href=#>hujnya</a><b>feh46y</b>
|
Только без формы и т.п.
Фишка в том, чтобы вставить скрипт в начало страницы и всё(он работает). Помогите. | |
|
|
|
|
|
|
|
для: LINKIN
(08.08.2005 в 20:03)
| | А почему бы не использовать htmlSprcialChars? | |
|
|
|
|
|
|
|
для: Евгений Петров
(08.08.2005 в 20:13)
| | что это??... | |
|
|
|
|
|
|
|
для: LINKIN
(08.08.2005 в 20:03)
| | Если не трудно, конкретизируйте. При добавлении скрипта в начало страницы, перевод чего должен осуществляться (контента страницы)? | |
|
|
|
|
|
|
|
для: Shogo
(08.08.2005 в 20:16)
| | да. всего что идет ниже вставленого скрипта(или вообще всей страницы). | |
|
|
|
|
|
|
|
для: LINKIN
(08.08.2005 в 20:03)
| | вот здесь нашел:
Here are some usefull functions.
They will apply || decode, htmlspecialchars || htmlentities recursivly to arrays() || to regular $variables. They also protect agains "double encoding".
<?PHP
function htmlspecialchars_or( $mixed, $quote_style = ENT_QUOTES ){
return is_array($mixed) ? array_map('htmlspecialchars_or',$mixed, array_fill(0,count($mixed),$quote_style)) : htmlspecialchars(htmlspecialchars_decode($mixed, $quote_style ),$quote_style);
}
function htmlspecialchars_decode( $mixed, $quote_style = ENT_QUOTES ) {
if(is_array($mixed)){
return array_map('htmlspecialchars_decode',$mixed, array_fill(0,count($mixed),$quote_style));
}
$trans_table = get_html_translation_table( HTML_SPECIALCHARS, $quote_style );
if( $trans_table["'"] != ''' ) { # some versions of PHP match single quotes to '
$trans_table["'"] = ''';
}
return (strtr($mixed, array_flip($trans_table)));
}
function htmlentities_or($mixed, $quote_style = ENT_QUOTES){
return is_array($mixed) ? array_map('htmlentities_or',$mixed, array_fill(0,count($mixed),$quote_style)) : htmlentities(htmlentities_decode($mixed, $quote_style ),$quote_style);
}
function htmlentities_decode( $mixed, $quote_style = ENT_QUOTES ) {
if(is_array($mixed)){
return array_map('htmlentities_decode',$mixed, array_fill(0,count($mixed),$quote_style));
}
$trans_table = get_html_translation_table(HTML_ENTITIES, $quote_style );
if( $trans_table["'"] != ''' ) { # some versions of PHP match single quotes to '
$trans_table["'"] = ''';
}
return (strtr($mixed, array_flip($trans_table)));
}
?>
These functions are an addition to an earlier post. I would like to give the person some credit but I do not know who it was.
<? ;llnu=u!eJq dHd?>
|
Это усиленная защита? я правильно понял? к сожалению я не знаю как этим пользоваться... | |
|
|
|