- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
// Защита от вставки HTML-кодов
function filter($string)
{
$string=stripslashes($string);
$string=ereg_replace("<","<",$string);
$string=ereg_replace(">",">",$string);
$string=ereg_replace('\\\"',""",$string);
$string=ereg_replace("!","!",$string);
$string=ereg_replace("\r","",$string);
$string=ereg_replace("\n","<BR>",$string);
$string=ereg_replace("%","%",$string);
$string=ereg_replace("^ +","",$string);
$string=ereg_replace(" +$","",$string);
$string=ereg_replace(" +"," ",$string);
$string=ereg_replace("\|"," ",$string);
return $string;
}
guest 29.07.2009 00:41 # 0
guest 29.07.2009 08:32 # +1
htmlspecialchars выглядит получше :)
guest 29.07.2009 13:17 # 0
guest 30.07.2009 17:39 # 0
guest 30.07.2009 19:50 # 0