have you set up your site in Dreamweaver correctly?
See our learning resources page for details on setting up your Dreamweaver site for dynamic development:
resources.php
after setting up your site, create a new php page, save it to the site and have that page open when creating your eCart Object.
Then when adding the Add to cart button make sure to have a php page open as well.