Keep your PHP and WordPress separate, using the shortcode [php-to-page] you can include PHP files in your pages.
Tested with WordPress 3.1.3 and above.
To use this plugin you can place the [php-to-page] shortcode using an argument in to any page.
- ‘file’ – this is the file you wish to include in your page.
You can find the plugin on the wordpress site, http://wordpress.org/extend/plugins/php-to-page/