Simple JAVA password page

  • Thread starter James E Middleton
  • Start date
J

James E Middleton

Sorry for pasting/posting so much code. The question I have is about 'Page
2', and will probably show what I want to change without 'Page1, 3 & 4'. But
I put them in also, as they are part of the set.

When going from page 1 to page 2, a script window pops up to enter a pass
word. I want to edit the text that appears:

-----
Explorer User Prompt

Script Prompt

Input Prompt
----

And if possible format the window but that's more of a wish than a need...

Anyway, the JAVA is here.


Page 1: save as 'pass_top.html'

______Start_________

<HTML>
<HEAD>
<TITLE>Top Page</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<BR>
<CENTER>

<H3><A HREF="pass.html">GO</FONT></A></H3>

</CENTER>

</BODY>
</HTML>


______Stop_________



Page 2: save as 'pass.html'

______Start________

<HTML>
<HEAD>
<TITLE>"koko wa title"</TITLE>

<Script Language="JavaScript">

var paWi1="password"; //tekitouna password wo kimetekudasai. ato de koko wa
kesitene.
var paMeWi1="Input Password"; //password wo ireru dialog box ga deta tokini
tukeru message wo kaitekudasai

var juCoWi1="ok.html"; //password ga ok no toki no file name
var juDiWi1="boo.html"; //password ga boo no toki no file name


function adWi1() {
var pa=prompt(paMeWi1,"");
if (pa==paWi1) location.href=juCoWi1;
else location.href=juDiWi1;
}
// End -->
</Script>

</HEAD>
<BODY BGCOLOR="#FFFFFF" onLoad="adWi1()">

</BODY>
</HTML>


______Stop_________



Page 3: save as 'boo.html'

______Start________

<HTML>
<HEAD>
<TITLE> </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<BR>
<CENTER>

<H3> Password Error! Please retry</H3><!-- no youni boo no toki no message
wo kaitekudasai-->
<A HREF="pass.html">Back</A>

</CENTER>

</BODY>
</HTML>

______Stop_________



Page 4: save as 'ok.html

______Start________

<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<BR>
<CENTER>

kono file wa password ga OK no toki no file desu.

</CENTER>

</BODY>
</HTML>

______Stop_________
 
R

Ronx

There is absolutely no JAVA in any of those pages. There is, however,
some JavaScript. Note that JAVA is NOT JavaScript.

As far as I can see, the script you are using is complicated, and has
absolutely no security. The password is on the page.

See www.rxs-enterprises.org/tests/jspass/ for a slightly more secure
implementation, (this may even point the way to answering your
question) but remember JavaScript is not the way to secure pages or
files.

If your site has FrontPage extensions and supports subwebs then see
Password Protect Part of a Web:
http://support.microsoft.com/default.aspx?scid=kb;en-us;301554

If you are hosted on a Windows server and can use ASP with a database,
then see
Protect individual pages:
http://support.microsoft.com/default.aspx?scid=kb;en-us;825498
 
J

James E Middleton

Thanks,

Sorry about the misnomer. That script has to be about 4 or 5 years old. I
used it a few years ago and it worked pretty well, but as you mentioned
there are better solutions out there now. I'll check out the links you
provided and try to find something suitable. Thank you very much for your
reply.

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top