Update example2.php

Separated PHP from HTML and fixed XSS vulnerability.