Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. app.get('/public.userinfo',(request, response) => {
  2. client.query('SELECT * FROM userinfo WHERE userin_id, username=$1 AND password=$2 '[request.body.username, request.body.password],
  3. result => response.send(result.row)
  4. )
  5. .catch(console.error);
  6. });
  7.  
  8. $.ajax({
  9. url:`public.userinfo`,
  10. method:'GET',
  11. dataType: 'json',
  12. data: {username:this.username, password:this.password, win:this.win, loss:this.loss},
  13. success: function(result){
  14. console.log(result);
  15.  
  16. },
  17. error:function(err){
  18. console.log(err);
  19. }
  20.  
  21.  
  22.  
  23. });
  24.  
  25. <form class="login" method= "GET" action="/public.userinfo" id="login">
  26. <input type="text" name="username" id="username" class="username">
  27. <input type="password" name="password" id="password" class="password">
  28. <button value="submit" name="login" id="loginButton">Login</button>
  29. <span id="login_message"></span>
  30. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement