Are you saving the file with the extension .php? Is PHP installed and enabled on your server?
The answer to at least one of these is "no", because what you are seeing is the raw PHP output in the HTML - if you use the browser's View Source, you'd see that clearly.