How do i use Webform API to submit my Custom Module form? OK kinda noob-ish question but im unfamiliar with the programing side of Drupal... Im currently building a Form from scratch in drupal 7 (custom module since im using Form_Panel to arrange my form fields) and i would like to implement the webform API into my code as the submit handler.(This way i can hopefully use webform UI to deal with submissions and viewing results at least) Currently i have all the form fields and a submit button but not much else...

function my_module_menu() {
$items = array();
$items['my_module/form'] = array(
'title' =&gt; t('Subscription'),
'page callback' =&gt; 'my_module_form',
'access arguments' =&gt; array('access content'),
'description' =&gt; t('Subscription'),
'type' =&gt; MENU_CALLBACK,
);
return $items;
//some random fields from form API after
///////////////////////////////////////////////////
////////////////// Submit button
$form['submit'] = array( 
 '#type' =&gt; 'submit',
 '#value' =&gt; 'Submit',
 '#submit' =&gt; array('my_module_my_form_submit'),
);
return $form;
}
function my_module_my_form_submit($edit,$form, $form_state) {
drupal_set_message('Submission recieved.');
}


And thats it.It shows perfectly on site and submit refreshes the page.. What i need to know is which function and methods should i use to get webform or drupal period to save my values(create a db table first?) and display them at the necessary time through whatever links on the site.
You want to use hook_schema() in your module.install file to make a database table to store your values. A small stupid logging schema I wrote is as follows:

function idprocessing_schema() {
  $schema['idprocessing_log'] = array(
    'description' =&gt; 'webextract process logging',
    'fields' =&gt; array(
      'id' =&gt; array(
        'description' =&gt; 'id of entry',
        'type' =&gt; 'serial',
        'unsigned' =&gt; TRUE,
        'not null' =&gt; TRUE,
      ),
      'created' =&gt; array(
        'description' =&gt; 'The Unix timestamp when the entry was made.',
        'type' =&gt; 'int',
        'not null' =&gt; TRUE,
        'default' =&gt; 0,
      ),
      'msg' =&gt; array(
        'description' =&gt; 'whats going on in the processing',
        'type' =&gt; 'text',
        'size' =&gt; 'medium',
        'not null' =&gt; FALSE,
      ),
      'num_students' =&gt; array(
        'description' =&gt; 'number of students from xpath query',
        'type' =&gt; 'int',
        'not null' =&gt; FALSE,
      ),
    ),
    'primary key' =&gt; array('id'),
  );
  return $schema;
}


You then insert into the table as needed with say db_insert() a Database API function of drupal.

  db_insert('idprocessing_log')
    -&gt;fields(array(
      'msg' =&gt; $msg,
      'num_students' =&gt; $cnt,
      'created' =&gt; REQUEST_TIME,
    ))
    -&gt;execute();


You would want to insert $form_state['values'] by the way in your my_module_my_form_submit function.