0

I am trying to create a login page in node.js, I've created app.js with my index.ejs as follows

My app.js:

var email=req.body.email;
var password=req.body.password;
connection.query('INSERT INTO  userlogin(email, password) VALUES (? , ?);' , [email, password], 
                  function(err, docs) {
                       if (err) res.json(err);
                          res.redirect('users.ejs');
              });

My indes.ejs:

Email:<input type="text" /><br>
Password:  <input type="password"/><br>  
<input type="button" value="Submit"/>
chridam
  • 100,957
  • 23
  • 236
  • 235
Rohit Dhiman
  • 125
  • 1
  • 1
  • 7

0 Answers0