i have created database named 'USERS' and also created 'USERS' table inside the database it looks like
now i run 'localhost:8000'. i got my login.html and also 'connected' message in console. now i want to know After Entering username password in login.html i want to validate usename password on 'verify' button click. how can i do that????? pls Help me.
Server.js:
var http=require('http');
var express=require('express');
var fs=require('fs');
var mysql=require('mysql');
var app=express();
var server=http.createServer(app);
server.listen(8000);
var connection=mysql.createConnection({
host:'localhost',
user:'root',
password:'root'
});
connection.connect(function(err) {
if(!err)
{
console.log('connected');
}
});
app.get('/', function(request,response){
fs.readFile('login.html', function(Error,Res){
if(!Error)
{
response.writeHead(200,{'content-type':'text/html'});
response.write(Res);
}
});
});
login.html:
<html>
<head>
<title>Angular Js</title>
<script src="assets/js/Angular.min.js"></script>
<style>
</style>
<body>
<input id="username" />
<input id="password" />
<button id="submit">Verify</button>
</body>
</html>