How do you handle static HTML forms saved in a "Basic Page" in Drupal 7? I am a Drupal newbie and have been asked to help with some issues on a Drupal implementation. I have been asked to handle HTML forms that have already been designed and saved in "Basic Page" as either "full html" or php.

I have googled but could not find an references to such form handling. Almost every piece of code I have seen generates forms using Drupal Form API. There is enough documentation to work with forms generated using the Form API.

I would like to know if there is a way to handle these static(ally generated) forms and if so how.
I think the reason you can't find any documentation is because doing this sort of thing is very much discouraged in Drupal.

Drupal's form API exists for a good reason:


It allows theme/module developers to build up a form very easily
It provides a unified approach for themes and modules to add elements/validation/logic to any form that exists in the system. A good example of this in action is the Captcha module, which has the capacity to hook into any form in the system and add CAPTCHA protection.
It provides automatic protection against Cross Site Request Forgeries (CSRF).


If you're not up for coding your forms you should instead check out the Webform module which has an easy to use UI allowing you to build up nodes with forms on them, and it has very powerful administration features.

If you really want to do it without using the Form API or Webform modules, though, you could probably try something like this in a custom module:

function MYMODULE_init() {
  if (isset($_POST['my_post_var'])) {
    // Do something with the $_POST data
  }
}


Be warned that your forms will not be protected from CSRF, nor will they have the ability to be changed by other parts of the system. It's also just not the 'Drupal' way to do things :)