As laserlight points out, the issue is that you have to configure apache in a way where it knows when you have a file with the extension of php, that means "hand the file off" to the php apache module for parsing. For this to work correctly, somewhere in your code, you should have something similar to:
AddType application/x-httpd-php .php
However that won't work either unless you have first enabled the PHP module which may require a line similar to:
LoadModule php5_module "c:/php/php5apache2.dll"
If this is still confusing for you, you have 2 choices. Read those links laserlight gave you and read through your preferred example again (since you have already invested some time doing it that particular way)...or, if you do not care to learn the ropes...just download and install xampp. It sets everything up automatically.