The web server only processes PHP scripts if the page's file name ends with .php, instead of the usual .html. So rename your page to .php, and you'll solve this problem right away.
In addition, your PHP code must always be placed between the tags <?php and ?>. This way, the web server knows exactly what is PHP code and what is HTML code.