How do I print results after submitting a Drupal form?
The normal way to handle this is to implement a multi-step workflow. See drupal_rebuild_form() for more information, but basically you set $form_state['rebuild'] = TRUE; in your submit handler, and in the original form function add a check to see if the form's been submitted. If it has, you have access to the submitted values and can manipulate the form as you see fit.

A very basic example:

function MYMODULE_some_form($form, &amp;$form_state) {
  // If the form has been submitted, output something related to the submission
  if (!empty($form_state['values']['some_field'])) {
    $form['submission'] = array(
      '#markup' =&gt; function_to_get_markup_from_value($form_state['values']['some_field'])
    );
  }
  else {
    // Otherwise build the normal form
    $form['some_field'] = array(
      '#type' =&gt; 'textfield',
      // ...
    );
  }

  return $form;
}

function MYMODULE_some_form_submit($form, &amp;$form_state) {
  $form_state['rebuild'] = TRUE;
}