How do I print results after submitting a Drupal form? I have a simple Drupal Module setup which has a single textbox.

I can return what was typed in the textbox using drupal_set_message():

function firstmodule_form1_submit($form, &amp;$form_state) {
    drupal_set_message(t("The user is $username"));
}


However echo $username; will not work for me, nothing is printed. How can I return results without using drupal_set_message()?
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;
}