Post: A simple password page coded in HTML?
12-04-2013, 08:01 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So I have made a simple website to store and manage all of my exam work and course work for school. It's nothing too fancy and I am only using HTML.

I'll be hosting it on my school account and I thought it'd be cool to make a page that requires a password that I set in the code and whenever the password is correct it will continue to index.html.

I don't care if in the code the password is displayed because no-one in my year knows how to even open a .html file for some reason 0.o

Can anyone share a code that can do this with me?
(adsbygoogle = window.adsbygoogle || []).push({});
12-05-2013, 12:27 AM #2
ICS Vortex
Between Light and Lies
Originally posted by mont266 View Post
So I have made a simple website to store and manage all of my exam work and course work for school. It's nothing too fancy and I am only using HTML.

I'll be hosting it on my school account and I thought it'd be cool to make a page that requires a password that I set in the code and whenever the password is correct it will continue to index.html.

I don't care if in the code the password is displayed because no-one in my year knows how to even open a .html file for some reason 0.o

Can anyone share a code that can do this with me?


    
<html>
<title>
Login page
</title>
<body>
<body bgcolor="blue">
<center>
<b><font color="red">Authorization Password</font></b>
<form name="login">
<input type="password" name="password"/>
<br>
<input type="button" onclick="check(this.form)" value="Login"/>
</form>
</center>
<script language="javascript">
function check(form)
{
if(form.password.value == "test") //your password
{
window.location.replace('https://www.theforeverdamned.com/') //website to redirect to if password is correct
}
else
{
alert("Password Invalid!") //error message to display if password is incorrect
}
}
</script>
</body>
</html>


make sure to replace form.password.value, window.location.replace, and alert("Password Invalid!") with your own information.

The following user thanked ICS Vortex for this useful post:

mont266
12-05-2013, 01:26 AM #3
Originally posted by ICS
    
<html>
<title>
Login page
</title>
<body>
<body bgcolor="blue">
<center>
<b><font color="red">Authorization Password</font></b>
<form name="login">
<input type="password" name="password"/>
<br>
<input type="button" onclick="check(this.form)" value="Login"/>
</form>
</center>
<script language="javascript">
function check(form)
{
if(form.password.value == "test") //your password
{
window.location.replace('https://www.theforeverdamned.com/') //website to redirect to if password is correct
}
else
{
alert("Password Invalid!") //error message to display if password is incorrect
}
}
</script>
</body>
</html>


make sure to replace form.password.value, window.location.replace, and alert("Password Invalid!") with your own information.


Thank you so much! Worked perfectly!
12-05-2013, 02:16 AM #4
ICS Vortex
Between Light and Lies
Originally posted by mont266 View Post
Thank you so much! Worked perfectly!


no problem
Smile
05-13-2014, 04:32 AM #5
brooklyn77
I am error
Wow for me who is someone that is new to this kind of coding, it all looks simple, but complicated to understand why everything is layed out like this. I'll be working on how to understand this before I try to make this lol Happy

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo