Results 1 to 4 of 4
  1. #1
    boyfrom75 is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default Please help with Pasword protected page Java script..!

    Can someone help me to edit this code...? PLEASE. it will take just 3 minutes...:)

    NOTE: this page has "User name" and "password" to login or redirect to another page.. But I dont need the password option.. I just need the " user name" , something very easy..
    I just want he visitor to Enter his/her "user name" and press login and the website will take him/her to the page that will be designed for this specific user..
    So, I just want to have unlimited "user names" but NO passwords....
    Can SOMEONE HELP ME WITH THIS... :)
    ======================
    Here is the code to edit:
    ===============================


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>

    <SCRIPT LANGUAGE="JavaScript">


    <!-- The JavaScript Source -->

    <!-- 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=0 cellpadding=0>
    <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=text name=password></td></tr>
    <tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
    </table>
    </form>
    <p>&nbsp;</p>
    </center>
    <p>
    <p>


    </body>
    </html>

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,299
    Blog Entries
    7
    Rep Power
    24

    Default Re: Please help with Pasword protected page Java script..!

    This is a Java forum; Java and Javascript are two quite different languages; better try again in a Javascript forum.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  3. #3
    boyfrom75 is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default Re: Please help with Pasword protected page Java script..!

    RE: This is a Java forum; Java and Javascript are two quite different languages; better try again in a Javascript forum......"


    And were I can find a Java Script forum...?

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,299
    Blog Entries
    7
    Rep Power
    24

    Default Re: Please help with Pasword protected page Java script..!

    Quote Originally Posted by boyfrom75 View Post
    And were I can find a Java Script forum...?
    I don't know but I'm (almost) sure that Google can help you out.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

Similar Threads

  1. Read pasword protected Excel file
    By vijay7539 in forum Advanced Java
    Replies: 2
    Last Post: 08-01-2014, 03:46 PM
  2. How to invoke shell script from JSP page
    By rajesh4851 in forum New To Java
    Replies: 7
    Last Post: 01-09-2012, 11:02 AM
  3. Using Protected Methods, in a Java Library
    By WACman in forum New To Java
    Replies: 3
    Last Post: 03-11-2011, 09:47 AM
  4. pasword script
    By ExGM in forum Java Applets
    Replies: 4
    Last Post: 11-13-2009, 04:50 PM
  5. Ask for help on Java access to protected methods
    By fangzhong in forum Advanced Java
    Replies: 3
    Last Post: 02-17-2009, 02:50 PM

Tags for this Thread

Posting Permissions

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