<slide title="Fixing XSS">
<break lines="1" />

<example fontsize="1.4em" title="Safe Form Handling" result="1"><![CDATA[<form action="<?php echo htmlspecialchars($PHP_SELF, ENT_QUOTES)?>" method="POST">
Your name: <input type=text name=name><br>
You age: <input type=text name=age><br>
<input type=submit>
</form>
<?php
if($_SERVER['REQUEST_METHOD']=='POST') {
  $Oname = htmlspecialchars($_POST['name'], ENT_QUOTES);
  $Oage  = (int)$_POST['age'];
  echo <<<EOB
Hi $Oname, you are $Oage years old.
EOB;
} ?>]]></example>

</slide>
