/    Sign up×
Community /Pin to ProfileBookmark

Hello!

I’ve got a problem! I’m a beginner in Java so can I ask something. I dowlnloaded a protector script and i can’t modify it. I want it to make this:

  • 1. The users enters the right password

  • 2. And the protected page opens in the same window. Not a new explorer.
  • This sript is Three Times
    Please help me!

    Or
    If somebody know a better scipt please send it to me.
    My e-mail is [email][email protected][/email]

    Thanks

    to post a comment
    JavaScript

    5 Comments(s)

    Copy linkTweet thisAlerts:
    @dabushMar 03.2003 — JavaScript is not good for password-protected webpages.
    Copy linkTweet thisAlerts:
    @CarserauthorMar 03.2003 — Thanks!

    Then what's better?

    Php or what?

    Here is the script:

    <SCRIPT LANGUAGE="JavaScript">

    <!-- This script and many more are available free online at -->

    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin

    function password() {

    var testV = 1;

    var pass1 = prompt('Please Enter Your Password','');

    while (testV < 3) {

    if (!pass1)

    history.go(-1);

    if (pass1 == "password") {

    alert('You Got it Right!');

    <!-- STEP TWO: Change protectedpage.html to your protected page -->

    // Change the following URL to your protected filename

    window.open('protectedpage.html');

    break;

    }

    testV+=1;

    var pass1 =

    prompt('Access Denied - Password Incorrect, Please Try Again.','Password');

    }

    if (pass1!="password" & testV ==3)


    history.go(-1);

    return " ";

    }

    // End -->

    </SCRIPT>

    </head>

    <!-- STEP THREE: Copy the last code into the BODY of your HTML document -->

    <BODY>

    <CENTER>

    <FORM>

    <input type="button" value="Enter Password Protected Area" onClick="password()">

    </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.10 KB -->

    As i told i wanna make that after the pass has entered, a page opens in the same window. (Now it opens ina new window and it not ok, beacuase the users can see my url.
    Copy linkTweet thisAlerts:
    @dabushMar 03.2003 — using that...you could make it in the same page by making it this

    <i>
    </i>&lt;SCRIPT LANGUAGE="JavaScript"&gt;

    &lt;!-- This script and many more are available free online at --&gt;
    &lt;!-- The JavaScript Source!! <a href="http://javascript.internet.com">http://javascript.internet.com</a> --&gt;

    &lt;!-- Begin
    function password() {
    var testV = 1;
    var pass1 = prompt('Please Enter Your Password','');
    while (testV &lt; 3) {
    if (!pass1)
    history.go(-1);
    if (pass1 == "password") {
    alert('You Got it Right!');

    &lt;!-- STEP TWO: Change protectedpage.html to your protected page --&gt;

    // Change the following URL to your protected filename

    window.location.href = 'protectedpage.html';
    break;
    }
    testV+=1;
    var pass1 =
    prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
    }
    if (pass1!="password" &amp; testV ==3)
    history.go(-1);
    return " ";
    }
    // End --&gt;
    &lt;/SCRIPT&gt;
    &lt;/head&gt;

    &lt;!-- STEP THREE: Copy the last code into the BODY of your HTML document --&gt;

    &lt;BODY&gt;

    &lt;CENTER&gt;
    &lt;FORM&gt;
    &lt;input type="button" value="Enter Password Protected Area" onClick="password()"&gt;
    &lt;/FORM&gt;
    &lt;/CENTER&gt;

    &lt;p&gt;&lt;center&gt;
    &lt;font face="arial, helvetica" size="-2"&gt;Free JavaScripts provided&lt;br&gt;
    by &lt;a href="http://javascriptsource.com"&gt;The JavaScript Source&lt;/a&gt;&lt;/font&gt;
    &lt;/center&gt;&lt;p&gt;

    &lt;!-- Script Size: 1.10 KB --&gt;
    Copy linkTweet thisAlerts:
    @dabushMar 03.2003 — but cgi would be the best for password-protected sites.
    Copy linkTweet thisAlerts:
    @pyroMar 03.2003 — [i]Originally posted by dabush [/i]

    [B]but cgi would be the best for password-protected sites. [/B][/QUOTE]
    Or PHP, or ASP, or any other server side language, probably...
    ×

    Success!

    Help @Carser 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.18,
    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,
    )...