Jump to content

How do I make a textbox not allow any HTML code


kpetsche20

Recommended Posts

when the form is submitted, use strip_tags() to remove html tags or even better use htmlentities() this will convert > to > etc thus making it view instead of parsa

 

example

<?php
$str = "hello world, here is some <b>BOLD</b> text";
echo strip_tags($str);
echo "<br>";
echo htmlentities($str);
?>

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.