My if statements are working everywhere except in my hook_block_view function I am trying to make a custom form block in drupal.  I want it to display my form, then after submitting, show the results.  I have an if statement in the hook_block_view function saying if my form has been filled out to set $block['content'] to "Form Submitted".  This doesn't work though, it just displays the form again.  I have the same if statement in my hook_form_submitted function to either set drupal_set_message to either 'Submitted' or to display what was put into the form.  After submitting, when the page reloads, The form still displays, $block['content'] does not get set, but drupal_set_message() does.  What am I doing wrong?

Just thought of something, my block_view() only passes ($delta = '') is it just that $form_state['values'] is not being passed through the function?

&lt;?php

/**
 * @file
 *
 */


 /**
 * Implements hook_block_info().
 */

 function search_engine_block_info() {
     $blocks = array();
     $blocks['search_engine'] = array(
        'info' =&gt; t('Search Engine'),
        'cache'=&gt; DRUPAL_CACHE_GLOBAL,
    );
    return $blocks;
 }

 /**
 * Implements hook_block_view().
 */

 function search_engine_block_view($delta = ''){
     $block = array();
     switch ($delta) {
     case 'search_engine':
         $block['subject'] = t('Search Engine');
         //Check to see if the form has been submitted.  If not, show form, or else show results.
         if(!isset($form_state['values']['searchInput'])){
            $block['content'] = drupal_get_form('search_engine_form');   
         }else{
            $block['content'] = 'Form Submitted';    
         }
     }
     return $block;
 }

 /**
 * Implements hook_form.
 */

 function search_engine_form ($form, &amp;$form_state){
    $form['searchOptions'] = array(
        '#type'     =&gt; 'select',
        '#title'    =&gt; t('You can search by GWF Number, name, email address or phone number.'),
        '#options'  =&gt; array(
            'gwf'           =&gt; t('GWF Number'),
            'applicant_email'   =&gt; t('Email Address'),
            'name'          =&gt; t('Name'),
            'phone_number'      =&gt; t('Phone Number'),
            ),
        '#value'    =&gt; 'gwf',
    );
    $form['searchInput'] = array(
        '#type'     =&gt; 'textfield',
        '#title'    =&gt; t(''),
    );
    $form['submit'] = array(
        '#type' =&gt; 'submit',
        '#value'=&gt; t('Submit'),
        );
    return $form;       
 }

 /**
 * Implements hook_form_submit.
 */

 function search_engine_form_submit($form, &amp;$form_state){
    if(isset($form_state['values']['submit'])){
        drupal_set_message('Sumbmitted!!');
    }else{
        drupal_set_message($form_state['values']['searchOptions']);
    }
 }
$form_state['values']['searchInput'] is undefined in that function so this will never work. You could remove the if in this function and let search_engine_form return HTML if it is submitted. You can add it inside the if you're using for the message display.

You maybe have to use the #rebuild option on that form, so it gets rebuild.