/    Sign up×
Community /Pin to ProfileBookmark

Javascript help needed urgently

Dear members/moderators,

I’m currently using a free online login script, and i’m having major problems with it. When i try to add more than 10 users to the script it does not work.
How can I solve this problem? Any help, please. ?
Below is the script i’m using.

<!– TWO STEPS TO INSTALL MULTIPLE USERS:

  • 1. Copy the first code into the HEAD of your HTML document

  • 2. Put the last coding into the BODY of your HTML document –>
  • <!– STEP ONE: Copy this code into the HEAD of your login HTML document –>

    <HEAD>

    <SCRIPT LANGUAGE=”JavaScript”>

    <!– This script and many more are available free online at –>
    <!– The JavaScript Source!! [url]http://javascript.internet.com[/url] –>

    <!– 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>

    <!– STEP TWO: Paste this code into the BODY of your HTML document –>

    <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=text name=password></td></tr> <tr><td colspan=2 align=center><input type=button value=”Login!” onClick=”Login()”></td></tr> </table> </form> </center>

    <p><center>
    <font face=”arial, helvetica” size=”-2″>Free JavaScripts provided<br> by <a href=”http://javascriptsource.com”>The JavaScript Source</a></font> </center><p>

    <!– Script Size: 1.60 KB –>

    Thanks,

    rsadik

    to post a comment
    JavaScript

    4 Comments(s)

    Copy linkTweet thisAlerts:
    @JPnycSep 22.2005 — You'd need to show us the script after you've made your changes to it. We need to see the 1 that doesn't work
    Copy linkTweet thisAlerts:
    @rsadikauthorSep 22.2005 — Thanks for replying.

    This is the link to the page where the script is not working.

    http://www.arrowtravel.com/trvlagents_login.htm
    Copy linkTweet thisAlerts:
    @NedalsSep 22.2005 — Not a very pretty script, and not remotely secure, but it should work for any number of users.

    Carefully check the syntax of the code you added.

    I would recommend that, at least, you modify the code to this.
    <i>
    </i>....
    if (username=="member1" &amp;&amp; password=="password1") { window.location="page1.html" }
    else if (username=="member2" &amp;&amp; password=="password2") { window.location="page2.html"; }
    else if (username=="member3" &amp;&amp; password=="password3") { window.location="page3.html"; }
    // add more users
    else { alert("Invalid login!"); }
    ....
    Copy linkTweet thisAlerts:
    @rsadikauthorSep 22.2005 — Dear Nedals,

    Thanks very much for your assistance.

    I've found the error in the code & it works now.
    ×

    Success!

    Help @rsadik spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.29,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...