When I submit the form, PHP echoes out tags exactly as I have written them instead of converting them into htmlentities. What is the problem?
PHP:
<?php
$name = htmlentities(substr($_POST["name"], 0, 100), ENT_QUOTES);
$email = htmlentities(substr($_POST["email"], 0, 100), ENT_QUOTES);
$msg = htmlentities(substr($_POST["message"], 0, 500), ENT_QUOTES);
echo ($name.'<br>'.$email.'<br>'.$msg);
HTML:
<html>
<body>
<form role="form" action="test.php" method="POST">
<p>Name:<input type="text" placeholder="Name" maxlength="100" name="name"></p>
<p>Email address:<input type="text" placeholder="Email" maxlength="100" name="email"></p>
<p>Message:<textarea rows="4" name="message" placeholder="Message" maxlength="500"></textarea></p>
<input type="submit" value="submit">
</form>
</body>
</html>