Author Topic: HTML Question  (Read 2817 times)

sam

  • Fanatic
  • ***
  • Posts: 303
  • This statement is false.
    • MSN Messenger - samlancashire@hotmail.com
    • View Profile
    • samlancashire.com
    • Email
HTML Question
« 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')

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: HTML Question
« Reply #1 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.
Edward Dassmesser

sam

  • Fanatic
  • ***
  • Posts: 303
  • This statement is false.
    • MSN Messenger - samlancashire@hotmail.com
    • View Profile
    • samlancashire.com
    • Email
Re: HTML Question
« Reply #2 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

bat

  • Fanatic
  • ***
  • Posts: 234
  • Cheak out the B*t project
    • MSN Messenger - ethanbatmay@hotmail.com
    • Yahoo Instant Messenger - ethanbatmay
    • View Profile
    • The B*t project
    • Email
Re: HTML Question
« Reply #3 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???
~bat