|
|
|
|
|
для: Рома
(18.08.2010 в 22:51)
| | А что вам не нравиться? | |
|
|
|
|
автор: ..... (18.08.2010 в 23:15) |
|
|
для: lElectroHardl
(18.08.2010 в 22:07)
| | Example #1 A filter_input() example
<?php
$search_html = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_SPECIAL_CHARS);
$search_url = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_ENCODED);
echo "You have searched for $search_html.\n";
echo "<a href='?search=$search_url'>Search again.</a>";
?>
|
The above example will output something similar to:
You have searched for Me & son.
<a href='?search=Me%20%26%20son'>Search again.</a> | |
|
|
|
|
|
|
|
для: lElectroHardl
(18.08.2010 в 22:07)
| | Вы точно себя хорошо чувствуете? Может врача вызовите? | |
|
|
|
|
|
|
| У кого-то есть какой-нибудь свой класс для проверки на:
допустимые символы,
русский, английский текст, цифры,
замена "htpp://site.ru" на "текст"
замена таких слов, как "select, delete..."
замена "<br>" на "br"
и т.д.
Что-то вроде такого
<? class filter
{
function html_symbols($input)
{
$text = preg_replace('%&\s*\{[^}]*(\}\s*;?|$)%', '', $input);
$text = preg_replace('/[<>]/', '', $text);
if(!get_magic_quotes_gpc())
{ $text = addslashes($text); }
$badwords = array('input', 'union', 'script', 'select', 'update', 'script', 'www', 'http', '.ru', '.com', 'http');
$text = str_replace($badwords, '', $text);
return $text;
}
function latin($input)
{
if(preg_match('/[^a-zA-Zа-яА-Я0-9_ ]/i', $input))
{ return true; }
else
{ return false; }
}
}
$filter = new filter;
|
Только более масштабный А дописывать все, что может встретиться - долго.
Заранее спасибо. | |
|
|
|
|