SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2002
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simple js password protection..error

    hi this might be a long post to absorb my words wisely,
    im a js newb , but i managed to make myself a really cool but simple javascript login form, its not for much important and i done have access to php, and every program ive downloaded in the last 5 months has been corrupt, even from purchased CD roms!, somethin with my pc

    anyway i got a problem with my javascript at:
    blue-shift.vze.com
    i get a mysterious error which seems to be a mistake but upon viewing my source and my .js files....nothing is misplaces mis spelt in the code! i need an expert to help me,
    the .js file url is:
    www27.brinkster.com/blueshiftdesign/login1.js
    the html file is:
    www27.brinkster.com/blueshiftdesign/index.htm

    if i could please get help from an expert
    if they cud download the two files onto thier pc and see if they can fix them for me
    ive tried almost everything,

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you give us a username and password so we can try and replicate the error?

    <edit> lol, nevermind, got those from viewing the source of the login1.js file!</edit>
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Aside from the obvious insecurities...

    I got this to work:

    login1.js
    Code:
    function Login(){
    
    var username=document.login.username.value;
    var password=document.login.password.value;
    var password2=document.login.password2.value;
    
    if (username=='matt' && password=='matt' && password2=='matt') { alert("User: Matt, /n Logged in 
    
    Succesfully."); window.location="verify.htm";}
    if (username=='dave' && password=='dave' && password2=='dave') { alert("User: Dave, /n Logged in 
    
    Succesfully."); window.location="verify.htm"; }
    else { alert("ACCESS DENIED"); }
    }
    index.html
    Code:
    <table  width="150" height="" border="0" cellspacing="0" cellpadding="0" marginwidth="0" marginheight="0" 
    
    leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0">
    
    <tr>
    <td width="10" height="7"><img src="tl.gif"></td>
    <td width="10" height="7" background="h.gif"></td>
    <td width="10" height="7"><img src="tr.gif"></td></tr>
    
    <tr>
    <td width="10" height="20"><img src="lt.gif"></td>
    <td width="8" height="20" background="ht.gif">
    <font face="arial" size="2" color="#1E90FF">
    Login
    </td>
    <td width="10" height="20"><img src="rt.gif"></td></tr>
    
    <tr>
    <td width="10" height="7" background="l.gif"></td>
    <td>
    <form name='login'>
    Username:<input name='username' type='text' size='15'>
    Password:<input name='password' type='password' size='15'>
    Password2:<input name='password2' type='password' size='15'>
    
    <input type=button value='Login!' onClick='Login();'>
    
    </form>
    </td>
    <td width="10" height="7" background="r.gif"></td></tr>
    
    <tr>
    <td width="10" height="7"><img src="bl.gif"></td>
    <td width="10" height="7" background="h.gif"></td>
    <td width="10" height="7"><img src="br.gif"></td></tr>
    
    </table>
    Do you also realise that you had no closing table row tags (like </TR>) ?
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •