Today, We want to share with you javascript login page with database.In this post we will show you bootstrap login form, hear for html code for login page with username and password we will give you demo and example for implement.In this post, we will learn about NodeJS Login And Registration Authentication Using Mysql with an example.
how to make a login page in html with database?
html login scripts
Example 1: index.html
<form action="action_page.php" method="post"> <div class="imgcontainer"> <img src="img_avatar2.png" alt="Avatar" class="avatar"> </div> <div class="container"> <label for="uname"><b>Username</b></label> <input type="text" placeholder="Enter Username" name="uname" required> <label for="psw"><b>Password</b></label> <input type="password" placeholder="Enter Password" name="psw" required> <button type="submit">Login</button> <label> <input type="checkbox" checked="checked" name="remember"> Remember me </label> </div> <div class="container" style="background-color:#f1f1f1"> <button type="button" class="cancelbtn">Cancel</button> <span class="psw">Forgot <a href="#">password?</a></span> </div> </form>
javascript login system
javascript code
var connection = mysql.createConnection({ host : 'yourhostname', user : 'yourusername', password : 'Dn8778754fds4%^&', database : 'simple_login_system_v1' });
how to make a signup page in html?
index.html
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { font-family: Arial, Helvetica, sans-serif; background-color: black; } * { box-sizing: border-box; } .container { padding: 16px; background-color: white; } input[type=text], input[type=password] { width: 100%; padding: 15px; margin: 5px 0 22px 0; display: inline-block; border: none; background: #f1f1f1; } input[type=text]:focus, input[type=password]:focus { background-color: #ddd; outline: none; } hr { border: 1px solid #f1f1f1; margin-bottom: 25px; } .registerbtn { background-color: #4CAF50; color: white; padding: 16px 20px; margin: 8px 0; border: none; cursor: pointer; width: 100%; opacity: 0.9; } .registerbtn:hover { opacity: 1; } a { color: dodgerblue; } .signin { background-color: #f1f1f1; text-align: center; } </style> </head> <body> <form action="/action_page.php"> <div class="container"> <h1>Register</h1> <p>Please fill in this form to create an account.</p> <hr> <label for="email"><b>Email</b></label> <input type="text" placeholder="Enter Email" name="email" required> <label for="psw"><b>Password</b></label> <input type="password" placeholder="Enter Password" name="psw" required> <label for="psw-repeat"><b>Repeat Password</b></label> <input type="password" placeholder="Repeat Password" name="psw-repeat" required> <hr> <p>By creating an account you agree to our <a href="#">Terms & Privacy</a>.</p> <button type="submit" class="registerbtn">Register</button> </div> <div class="container signin"> <p>Already have an account? <a href="#">Sign in</a>.</p> </div> </form> </body> </html>
open page with html
<!DOCTYPE html> ## Code by www.pakainfo.com (Twitter @pakainfo) <html> <body> <a href="https://www.pakainfo.com" target="_blank" rel="noopener">Pakainfoooooooo!</a> </body> </html>
I hope you get an idea about javascript login page with mysql database.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.