50 users online (1 members and 49 guests)  

Thread: Password Code


  Results 1 to 7 of 7

Related

  1. password protection    Forum: Javascript Forum
    Replies: 2
  2. Replies: 0
  3. Ignore code and link greeting note code    Forum: HTML Forum
    Replies: 3
  4. Replies: 1
  5. log in and password code    Forum: Website Scripts Forum
    Replies: 7
  1. #1
    raaj22's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2009
    Posts
    10

    Password Code

    here is source code of username and password in javascript...
    Code:
    <html>
    <head>
    <SCRIPT LANGUAGE="JavaScript">
    
    
    
    <!-- Begin
    function Login(){
    var done=0;
    var username=document.login.username.value;
    username=username.toLowerCase();
    var password=document.login.password.value;
    password=password.toLowerCase();
    if (username=="member1" && password=="password1") { window.location="page1.html"; done=1; }
    if (username=="member2" && password=="password2") { window.location="page2.html"; done=1; }
    if (username=="member3" && password=="password3") { window.location="page3.html"; done=1; }
    if (done==0) { alert("Invalid login!"); }
    }
    // End -->
    </SCRIPT>
    </head>
    <body>
    <center>
    <form name=login>
    <table width=225 border=1 cellpadding=3>
    <tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr>
    <tr><td>Username:</td><td><input type=text name=username></td></tr>
    <tr><td>Password:</td><td><input type=password name=password></td></tr>
    <tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
    </table>
    </form>
    </center>
    </body>
    </html>

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Re: Password Code

    Never use the above code or any JS for login purposes.

    Show me a site using this script and I will show you every users password.
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting

  3. #3
    adamsen's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Jan 2009
    Location
    Denmark
    Posts
    128

    Question Re: Password Code

    Thatīs right, but do you know a code which can do the same, but without that problem you showed. I would be interested, because I need a good code for my site, where I also have to use a password.

  4. #4
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Password Code

    For logins, you will want to use one of two methods. Either a server-side script (PHP, ASP, etc.), or an htpasswd file.

    I am going to assume that you are using PHP. Let me know, and I will point you in the right direction.

  5. #5
    adamsen's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Jan 2009
    Location
    Denmark
    Posts
    128

    Re: Password Code

    Okay itīs PHP! I dont know that much about PHP, but thanks. I will maybe ask you if im going to learn PHP, but i donīt have so much time. Thanks for the information.
    Adamsen

  6. #6
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Password Code

    Here is one you can use. It even has some pretty good instructions. http://php-login-script.com/

  7. #7
    adamsen's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Jan 2009
    Location
    Denmark
    Posts
    128

    Re: Password Code

    Thanks a lot



Tags for this Thread