+ 4
How can I create a password protected login system in html
I've created a simple login system but I want to give a specific password to it without which one cannot go ahead So can anyone pls tell a solution I am ready to use javascript for it
11 Answers
+ 1
Atharva Varule th JS code:
In the HTML there are two main containers:
The sign_in page wraps the whole sign_in page (the input, and the sign_in text).
And the content page. The content page is your content -your website.
Also there is the submit button:
<button onclick = âcheck()â> Submit </button>
In the JS, I selected the sign_inPage (the container), and the input (where you enter the password).
When you click the button,
function check(){
if (input.value == âABCâ){
document.body.removeChild(sign_inPage }
that means:
If (the input value is ABC){remove the sign_inPage}
you can change the âABCâ to anything you want, and whatever you change it to will be the password.
let me know if u have any questions
+ 1
Iâve made something like that before.
If we are on the same page:
So thereâs a password box, and youâll have to tell them the passeeord if they want to access the content.
This is what my code looks like:
https://code.sololearn.com/W74zppj0I2MF/?ref=app
Let me knownif you have any questions or if you want me to walk you through.
The password for my code is: h5qk40
+ 1
That code isn't working
It's showing some error
+ 1
Atharva Varule , hmm, it works for me on my phone (ios).
Let me try to code another one...
+ 1
Atharva Varule What about this one?:
https://code.sololearn.com/WTrxQYE8Puky/?ref=app
The password is âABCâ
(capital, no space).
+ 1
Can you pls explain me the js code u used ??
+ 1
You can create an HTML page but need scripting languages to add functionalities. If you want to make a login system, you can use PHP and SQL to create a user login system that stores passwords in a database.
+ 1
Ok
Thanks a lot Ginfio
No other question sir
+ 1
Thanks a lot ashish neupane
0
Yes it's working
0
Thanks a lot Ginfio
đđ