Guest User

Untitled

a guest
Sep 27th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. app.post('/loginform', function (req, res, next) {
  2.  
  3. let sql = `SELECT * FROM Users WHERE Username = ? and Password = ?`;
  4. let Username = `${req.body.name}`;
  5. let Password = `${req.body.password}`;
  6. let success;
  7.  
  8. db.get(sql, [Username, Password], (err, row) => {
  9. if (err) {
  10. return console.error(err.message);
  11. }
  12. return row
  13. ? console.log(`Login Success `+ row.ID, row.Username,row.Password)
  14. : console.log(`Sorry, your username and password are incorrect. Try again!`);
  15. });
  16. });
Add Comment
Please, Sign In to add comment