title: Verify custom table in magento for custom module
body: <p>I have made the redirect  from the question i have posted <a href="https://stackoverflow.com/questions/33627684/database-getting-updated-wrong-from-custom-module-form-after-validation">here</a>
  Now i have another form in the redirected page where i need to enter name and mobile number and if it matches in my db table <strong>helloworld</strong> it will go to one page or else to another</p>
  
  <pre><code>&lt;p&gt;You have successfully registered&lt;/p&gt;
  &lt;div&gt;
      &lt;label&gt;Login&lt;/label&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;form action="" method="post"&gt;
          &lt;label&gt; Username &lt;/label&gt;
          &lt;strong&gt;:&lt;/strong&gt;
          &lt;input class="input-text required-entry" type="text" name="fname" maxlength="20"&gt;
          &lt;label&gt;Mobile No&lt;/label&gt;
          &lt;strong&gt;:&lt;/strong&gt;
          &lt;input class="required-entry" type="number" maxlength="10" name="mobileno"&gt;
          &lt;input type="submit" name="login" value="Login"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
          &lt;input type="button" name="cancel" value="Cancel"&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Can any one help me how no i can verify it with existing data in db and make this work ? Shall I start it with using index controller or is there any magento way?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>this is my Indexcontroler.php after below answer update</p>
  
  <pre><code>&lt;?php
  class MyCustom_Helloworld_IndexController extends  Mage_Core_Controller_Front_Action
  {
  
  /*
  * this method privides default action.
  */
  public function indexAction()
  {
  if($this-&gt;getRequest()-&gt;getParams()) {
  $param = $this-&gt;getRequest()-&gt;getParams();
  
  
  echo $firstname = $param['fname'];
  $lastname = $param['lname'];
  $address = $param['address'];
  $state = $param['state'];
  $city = $param['city'];
  $mobile = $param['mobileno'];
  
  
  
  $model = Mage::getModel('helloworld/helloworld');
  // $model-&gt;setTitle($title);
  $model-&gt;setFirstname($firstname);
  $model-&gt;setLastname($lastname);
  $model-&gt;setAddress($address);
  $model-&gt;setState($state);
  $model-&gt;setCity($city); 
  $model-&gt;setMobileno($mobile); 
  $model-&gt;save();   
  $this-&gt;_redirect('helloworld/index/login');
  // $this-&gt;_redirectReferer();
  }else {
  
  
  /*
  * Initialization of Mage_Core_Model_Layout model
  */
  $this-&gt;loadLayout();
  /*
  * Building page according to layout confuration
  */
  $this-&gt;renderLayout();
  
  }
  
  
  
  }
  public function loginAction()
  {
  $this-&gt;loadLayout();     
  $this-&gt;renderLayout();
  
  }
  public function loginnAction()
    {
    if($this-&gt;getRequest()-&gt;getParams()) {
    $param = $this-&gt;getRequest()-&gt;getParams();
  
  
        $username = $param['fname'];
        $mobile = $param['mobileno'];
  
        $check = Mage::getModel('helloworld/helloworld')
                  -&gt;AddFieldToFilter('mobileno', array('eq' =&gt; $mobile))
                  -&gt;AddFieldToFilter('fname', array('eq' =&gt; $username));
   if(count($check)==1) {
   $this-&gt;_redirectReferer();
   }else {
   $this-&gt;_redirect('helloworld/index/login');
    }
  
  }
  }
  }
  </code></pre>