it sounds like you're opening the file via the file system instead of the webserver. in the xampp control panel make sure you have apache running, then open your browser of choice and navigate to http://localhost to confirm that your local webserver is running. when you want to see the results of php instead of just seeing the code, you have to get there via http://localhost/path/file.php in your browser. don't use file paths like c:\... etc