Dreamweaver and your browser alone are not enough to display your php scripts correctly.
If you are running a PC, you will have to download PHP and set up your box to run IIS, or you can download a pre-fab series of applications like wampserver(.com) to set up PHP and a server for you to run your tests on.
After you install wampserver, you will have to create sites via dreamweaver differently, too.
There will be THREE things you need to set up:
1) Local site, where your files exist on your computer. (They will now have to be located withing the www directory inside the WAMP folder.)
2) Your remote site/FTP info
3) Your testing server info (a way to test your files on your computer using localhost as the server address)
So, lets say you install WAMP inside your C: drive.
And then you create a site within the "www" directory called "test"
You will have to define your testing server address as:
http://localhost/wamp/test
(or is it http://localhost/test It is one of these...)
You will have to specify your test server as being PHP/MySQL and that you are running it on a "local network"