problem in code
===============

```
var userID = req.userid;
var pwd = req.pwd;
console.log("userid = " + userID + "pass = " + pwd);

```

> 
> the console shows values undefined instead of input data
> 
> 
> the console shows values undefined instead of input data
> 
> 
> I want to take data from an html file and insert into the mongo database using get method. But I am not able to fetch data from the textbox.
> 
> 
> 

Code in nodejs(index.js)
========================

```
const express = require('express');
const path = require('path');
const bodyparser = require("body-parser");
const mongoose = require('mongoose');
const app = express();
app.use(bodyparser());
app.use(bodyparser.urlencoded({
    extended: false
}));
app.use(bodyparser.json());
app.set('port', (process.env.PORT || 1000));
mongoose.connect('mongodb://localhost/TrackDB');
var Schema = new mongoose.Schema({
    username: String
    , pass: String
});
var users = mongoose.model('users', Schema);
app.get("/register", function (req, res) {
    var userID = req.userid;
    var pwd = req.pwd;
    console.log("userid = " + userID + "pass = " + pwd);
    new users({
        username: userID
        , pass: pwd
    }).save(function (err, doc) {
        if (err) {
            res.json(err);
        }
        else res.send("Successfully Registerd!");
    });
    console.log("users = " + users);
});
app.get("/", (req, res) => {
    res.sendFile(path.join(__dirname, './public/index.html'));
});
app.listen(1000, () => {
    console.log("Server Start......");
});

```

HTML Page (index.html)
======================

```
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>LOGIN/REGISTER</title>
    <style>
        #container {
            width: 40%;
            margin: auto;
            border: 1px solid;
            padding: 10px;
            padding-left: 200px;
            border-radius: 10px;
        }
    </style>
</head>

<body>
    <div id="container">
        <h1>Register</h1>
        <form action="/register">
            <div id="register">
                <input type="text" name="userid" id="txt_userid" placeholder="Enter user id">
                <br>
                <input type="password" name="pwd" id="txt_pass" placeholder="Enter password">
                <br>
                <br>
                <button type="submit" id="btn_register">Register</button>
            </div>
        </form>
        <h1>Login</h1>
        <form action="/login">
            <br>
            <br>
            <div id="login">
                <input type="text" name="user" id="userid" placeholder="Enter user id">
                <br>
                <br>
                <input type="password" name="passw" id="pass" placeholder="Enter password">
                <br>
                <br>
                <button type="submit" id="btn_login">Login</button>
            </div>
        </form>
        <h1 id="msg"></h1> </div>
</body>

</html>

```