How do I build a form with embedded view results
Sign Up Form

&lt;?php
    function formfun_menu() {
    $items = array();
    $items['formfun'] = array( //this creates a URL that will call this form at "examples/form-example"
    'title' =&gt; 'FORM FUN',
    'description' =&gt; 'A form to mess around with.',
    'page callback' =&gt; 'drupal_get_form', //this is the function that will be called when the page is accessed.  for a form, use drupal_get_form
    'page arguments' =&gt; array('formfun_form'), //put the name of the form here
    'type' =&gt; MENU_NORMAL_ITEM,

    'access callback' =&gt; TRUE
  );
  return $items;
}

function formfun_upload_form($form, &amp;$form_state) {

$form['add'] = array(
 '#type' =&gt; 'fieldset',
'#title' =&gt; t('Add company details'),
);
  $form['add']['companyname'] = array(
    '#type' =&gt; 'textfield',
    '#required' =&gt; TRUE,
    '#title' =&gt; 'Company Name',
  );

  $form['add']['contactname'] = array(
    '#type' =&gt; 'textfield',
    '#required' =&gt; TRUE,
    '#title' =&gt; 'Contact Name',
  );

    $form['add']['companyaddress'] = array(
    '#type' =&gt; 'textarea',
    '#required' =&gt; TRUE,
    '#title' =&gt; 'Contact Address',
  );

    $form['add']['postalcode'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; 'Postal Code',
  );

    $form['add']['city'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; 'City',
  );

    $form['add']['country'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; 'Country',
  );

    $form['add']['file'] = array(
        '#type'     =&gt; 'file',
        '#title'    =&gt; t('Choose a file'),  
);

  $form['add']['submit_button'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Click Here!'),

  );
   return $form;
}

function formfun_submit($form, &amp;$form_state) {

    echo '&lt;pre&gt;';
var_dump($form_state['values']);
echo '&lt;/pre&gt;';

    db_insert('details')
    -&gt;fields(array(
    'companyname' =&gt; $form_state['values']['companyname'],
        'contactname' =&gt; $form_state['values']['contactname'], 
        'companyaddress' =&gt; $form_state['values']['companyaddress'], 
         'postalcode' =&gt; $form_state['values']['postalcode'],  
        'city' =&gt; $form_state['values']['city'],  
         'country' =&gt; $form_state['values']['country'],  
         'image' =&gt; $form_state['values']['file'],
   ))
   -&gt;execute();
    drupal_set_message("successfully saved Security Settings"); 
    exit();
}

function formfun_validate($form,&amp;$form_state) 

{
  }