Adding a username and password

7 posts Page 1 of 1
Contributors
User avatar
DreadNought
VIP - Donator
VIP - Donator
Posts: 116
Joined: Fri Jan 08, 2010 12:37 pm

Adding a username and password
DreadNought
Hello everyone,
This can also be found in the Javascript section as this does contain some javascriptviewtopic.php?f=88&t=941

I just wonna make 1 thing clear before we start the tourtrial. This code CAN be broken by hackers, you should also know that HTML is NOT secure so if you want a secure username/password try a .htaccess or a PHP but anyway I will show you how to do this anyway here is the code,
Code: Select all
<script language="javascript">
function pasuser(form) {
if (form.id.value=="USERNAME") { 
if (form.pass.value=="PASSWORD") {              
location="SUCCESS.html" 
} else {
alert("Invalid Password")
}
} else {  alert("Invalid UserID")
}
}
//-->
</script>

<center>
<table bgcolor="white" cellpadding="12" border="1">
<tr><td colspan="2"><center><h1><i><b>Login
Area</b></i></h1></center></td></tr>
<tr><td><h1><i><b>UserID:</b></i></h1></td><td><form name="login"><input
name="id" type="text"></td></tr>
<tr><td><h1><i><b>Password:</b></i></h1></td><td><input name="pass"
type="password"></td></tr>
<tr><td><center><input type="button" value="Login"
onClick="pasuser(this.form)"></center></td><td><center><br><input
type="Reset"></form></td></tr></table></center> 
First, find the line's
Code: Select all
if (form.id.value=="USERNAME") { 
if (form.pass.value=="PASSWORD") { 
and edit were it ses USERNAME to the username you want people to use in order to access the website and change were it ses PASSWORD to the password you want people to use in order to access the passworded page

Second, Find the line
Code: Select all
location="SUCCESS.html" 
change SUCCESS to the page you want people to go to if the username and password is correct,

Tah Dah, all done

goto http://www.crazygaming.x10hosting.com/logintest.html and the username and password is
Username: codenstuff
Password: paralyzer

That is my website so,

Have fun with your login script
Bound and boom tech,
The Future Of Coding
User avatar
Manitara
Just Registered
Just Registered
Posts: 5
Joined: Thu Oct 29, 2009 4:06 pm

Re: Adding a username and password
Manitara
All your HTML tutorials demo's no longer exist.. Website down?
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Adding a username and password
Lewis
You wont realy need a demo :P Put it on your computer it will work :P
Image
User avatar
DreadNought
VIP - Donator
VIP - Donator
Posts: 116
Joined: Fri Jan 08, 2010 12:37 pm

Sorry, I didn't know that my website has ever been down but it is all up and working now.
Bound and boom tech,
The Future Of Coding
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 445
Joined: Tue Feb 16, 2010 6:24 am

Very nice Tutorial :D
Image
User avatar
35000vr
Top Poster
Top Poster
Posts: 176
Joined: Sat Mar 06, 2010 5:09 pm

Re: Adding a username and password
35000vr
Nice one!
‼ <----- Copy it,it is together and if you backspace it it will both erase
☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"<-----Some Cool symbols.
♂<-----Boy Symbol :)
²ƽ<--------Mini 2 and 5!
ð<----Not sure what it is.
☺☻<-----Smiles
♪♫<----Music Notes
Others:ß┬ƒ○║■ã¿┼↑
User avatar
DreadNought
VIP - Donator
VIP - Donator
Posts: 116
Joined: Fri Jan 08, 2010 12:37 pm

Very sorry the link does not work anymore. Try it!
Bound and boom tech,
The Future Of Coding
7 posts Page 1 of 1
Return to “Tutorials”