How to add a php to a custom page
You need to implement a custom module which defines a form and a path to this form.

In Drupal forms are implemented with the Form API. Please check this links for more information


http://drupal.org/node/751826
http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7


You can define the path by implementing hook_menu.