<html>
<head>
<title>Process an HTML form</title>
</head>
<body bgcolor=lightyellow>
<h2>Clean up data with addslashes( ) and htmlentities( ) </h2>
<br><br>
<?php
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); //turn off notices and warnings
$comment = $_GET['comment'];
echo "<b>You entered - </b>
<br> $comment <br><br>";
if(! get_magic_quotes_gpc())
$comment = addslashes($comment);
echo "<b>After addslashes( ) - </b>
<br> $comment <br><br>";
$comment = htmlentities($comment);
echo "<b>After htmlentities( ) - </b>
<br> $comment <br><br>";
$comment = nl2br($comment);
echo "<b>After nl2br( ) - </b>
<br> $comment <br><br>";
?>
</form>
<?php include "../include.php"; ?> <!-- hyperlink to see the code -->
</body>
</html>