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"/>