There’s a few plugins like
http://wordpress.org/extend/plugins/wp-exec-php/
But just for info ive seen a few cases where the code fails.
The best way really is a custom page template, or shortcode, depending what you need
Well basically, I just need 1 page where it has my current theme in, with a PHP form on it. I’ve already coded the PHP form but have no way of getting it in a page.
Unfortunately, forms is where that plugin usually fails the most
Best way to add your form is to make a copy of page.php, place your code right under the_content on that new file, name the file whatever you want.
Then at the top of the file add
<?php
/*
Template Name: Whatever
*/
?>
And you have a template. Simply make a new page through the add new interface in WP, and assigne your new template to that page from the attributes menu
Normally, you can only choose custom templates on WP pages (not on posts). So another way to do this is to create your own shortcode and run your code that way, but that takes some custom coding…
http://www.packtpub.com/wordpress-3-plugin-development-essentials/book