how to create a custom form and embed it on a node
The way I would go about it is to create the form within a Drupal block. In this manner, you could configure when &amp; where the form could be placed on the page and with what types of content. You also wouldn't have to edit your theme if you'd ever wanted to add the form to another type of content.

Look at hook_block_info() &amp; hook_block_view(), and reference the user module's implementation (user_block_info() &amp; user_block_view()) for how it create its user login block.