First, because your file has extension "html" (test.html) the web server will not process as PHP. PHP files need to have extension
.php if not php2 or php3 if you're using those.
Second, I believe you have a space in between the opening tag with question mark and the word "php". Those should be altogether as in
<?php ... code ... ?>