Jump to content

htmlspecialchars not working?


bluwe

Recommended Posts

Hiya,

I'm trying to stop html being entered into my database. I'm checking what is being posted with the following script:

<?
foreach ($_POST as $field => $value)
{
$value = htmlspaecialchars;
$value = strip_tags;
$value = trim;
}
foreach ($_POST as $field => $value)
{
echo "$field = $value<br>";
}
?>
</body></html>

strip tags seems to be working but i can still put html in the form and the script echoes it back to me. Any ideas?

Cheers
Link to comment
https://forums.phpfreaks.com/topic/26921-htmlspecialchars-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.