opening a file from the file browser will not interpret the PHP and render it as HTML. to do that you MUST open the file in the (internet) browser, and further more it needs to be specified as a web page not a file location
eg
http://localhost/path/to/file/filename.ext
as opposed to
c:/path/to/file/filename.ext
if you try to open the file in your internet browser as an absolute path to the file as opposed to a web page it will bot go through the web server. the server interprets the PHP and renders HTML data to the (internet) browser.