Hypothetical here: Let's say that you have a JavaScript file that uses jQuery to get input from the user. For example:
var $input = 0;
var buttonClick = function() {
$('.button').click(function() {
$input = $('input').val();
});
}
$(document).ready(buttonClick());
But what if you want to use sql to see if the input matches a password in a database
- How would you tell the sql script to run after you click the button?
- How would you share the
$input
variable the sql script so it could check it against the database?