nvee Posted November 14, 2009 Share Posted November 14, 2009 I want to send all my posted variables to my POSTVAR() function to strip_tags and also run a htmlspecialchars() - It appears to complete strip_tags(), but still passes html special characters. Any ideas on why it wont work? function POSTVAR($varname) { $postname = $_POST["$varname"]; $strip = strip_tags($postname, '<p><a><ul><li>'); $return = htmlspecialchars($strip); return $return; } Link to comment https://forums.phpfreaks.com/topic/181493-validation-function-not-working-properly/ Share on other sites More sharing options...
rarebit Posted November 14, 2009 Share Posted November 14, 2009 The manual is your friend: http://uk2.php.net/manual/en/function.htmlspecialchars.php $new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES); Link to comment https://forums.phpfreaks.com/topic/181493-validation-function-not-working-properly/#findComment-957402 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.