How to get the user entered input value to do calculation? I am developing bank loan application in drupal 7. In my first page there is a option to enter the loan amount then --> Search the available loan. In a second page(form) i need to display the available loan offers, interest, etc... based on the user entered value in page-1. Now i need to get the user entered value on page-2 and have to check with DB(Database) and then needs to display the results. Help me to get out the solution.
Store the loan amount in session when user submit the form1, and when rendering the form take that session value and display a suggestion field.

The code will be like below,

function form1_submit($form, &amp;$form_state) {
  $_SESSION['loan_search_amount_field_value'] = $form_state['values']['loan_search_amount_field_name'];
}

function form2() {
  $form = array();
  $loan_amount = $_SESSION['loan_search_amount_field_value'];
  //db_query using $loan_amount
  //$db_result_array = db_query();
  $form['load_options'] = array(
    '#description' =&gt; t('Loan options'),    
    '#type' =&gt; 'select',
    '#title' =&gt; t('Field type'),
    '#options' =&gt; $db_result_array,
    '#size' =&gt; 2,
  );      
  return $form;
}