title: How to redirect to next page in Express js
body: <pre><code> index.hbs
  
      &lt;h1&gt; {{LoginTitle}} &lt;/h1&gt;
        &lt;form action="/login" method="post"&gt;
         &lt;label for="Email"&gt;Email&lt;/label&gt;
           &lt;input type="text" name="Email" id="Email" placeholder="Email"&gt;
          &lt;label for="password"&gt;password&lt;/label&gt;
           &lt;input type="text" name="password" id="password 
              placeholder="password"&gt;
           &lt;input type ="button" value="SignIn"  onClick="'/welcome'"&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>index.js</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var mongo = require('mongodb');
  var url = 'mongodb://localhost:27017/test';
  
  /* GET home page. */
  router.get('/', function(req, res, next) {
  res.render('index', { LoginTitle: 'HOUSEHOLD EXPENSE' });
  });
  
  router.get('/login', function(req, res, next) {
  res.render('welcome', { welcome : 'hey' });
  });
  
  router.post('/login', function(req,res,next){
  if(req.body.Email == Email &amp;&amp; req.body.password == password){
      res.render('welcome');
   }
   else
   {
    res.render('/');
    }
  
    });
  
    module.exports = router;
  </code></pre>
  
  <p>welcome.hbs</p>
  
  <pre><code>  &lt;h1&gt; {{ welcome }}&lt;/h1&gt;
  
    &lt;p&gt; Hello Mr User&lt;/p&gt;
  </code></pre>
  
  <p>I am using express handlebars.After successful logging in it is not going to next page welcome.hbs Can anyone let me know what mistake I am doing</p>