Scrolling Game Development Kit Forum

General => Off-Topic => Topic started by: sam on 2006-04-28, 07:16:44 PM

Title: HTML Question
Post by: sam on 2006-04-28, 07:16:44 PM
Okay, I'm trying to make a login/password type thing. Its simple and isnt going to be used for anything but I want to make it so after you put in the correct password it takes you to a different page. So far I have it so if you put the right password in it says correct and if you put the wrong password in it says incorrect.
Here's the code:
[code]<HTML>
<SCRIPT LANGUAGE="JAVASCRIPT">
var pass='jack'
</SCRIPT>
<SCRIPT LANGUAGE="JAVASCRIPT">
function login() {
 pwd_input=prompt('Please enter your password and click OK')
Title: Re: HTML Question
Post by: durnurd on 2006-04-28, 11:39:10 PM
Code: [Select]
<HTML>
<SCRIPT LANGUAGE="JAVASCRIPT">
var pass='jack';
var pageGood = 'hidden.html';
var pageBad = 'noPass.html';

function login() {
   pwd_input=prompt('Please enter your password and click OK')
   if  ( pwd_input==pass ) {
      document.location.href=pageGood;
   } else {
      document.location.href=pageBad;
}
</SCRIPT>
<FORM>
<INPUT TYPE=BUTTON VALUE=Login NAME=LOGIN ONCLICK=login()>
</FORM>
</HTML>

Of course, anybody who has access to the source code (i.e. anybody) could very easily get past this in more ways than one.
Title: Re: HTML Question
Post by: sam on 2006-04-29, 07:05:31 AM
Thanks, and I know the password could easily be found in the source code, thats why I dont plan on using it for anything
Title: Re: HTML Question
Post by: bat on 2006-08-05, 05:10:39 PM
a password can be done in flash, can't it? and isn't there a free flash compiler???