Click to See Complete Forum and Search --> : protect


Carser
03-02-2003, 11:09 PM
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 full_warez@freemail.hu

Thanks

dabush
03-02-2003, 11:14 PM
JavaScript is not good for password-protected webpages.

Carser
03-02-2003, 11:27 PM
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.

dabush
03-03-2003, 12:04 AM
using that...you could make it in the same page by making it this


<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.location.href = '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 -->

dabush
03-03-2003, 12:05 AM
but cgi would be the best for password-protected sites.

pyro
03-03-2003, 07:50 AM
Originally posted by dabush
but cgi would be the best for password-protected sites. Or PHP, or ASP, or any other server side language, probably...