webdev007
Programmer
- Sep 9, 2005
- 168
This is part of a class
this simple function is aiming at using htmlentites.
somewhere I do not see what is wrong because if I test it with for example "<b>xxxxx</b>"
the echoed result is still "<b>xxxxx</b>
<?php
error_reporting(E_ALL);
function CleanPost($str)
{
if (isset ($str) && !empty($str) )
{
return htmlentities($str, ENT_QUOTES);
}
}
// Testing **********
$str=($_POST['url']);
echo CleanPost($str);
?>
this simple function is aiming at using htmlentites.
somewhere I do not see what is wrong because if I test it with for example "<b>xxxxx</b>"
the echoed result is still "<b>xxxxx</b>
<?php
error_reporting(E_ALL);
function CleanPost($str)
{
if (isset ($str) && !empty($str) )
{
return htmlentities($str, ENT_QUOTES);
}
}
// Testing **********
$str=($_POST['url']);
echo CleanPost($str);
?>