Greetings, just4fun2!
Your Clarification was helpful, thanks. It confirmed that you are
willing to work with a little javascript to accomplish your goal.
I've selected a password protection javascript that is considered to
be one of the best available. Any javascript can be defeated, of
course, but "Password Protection - Login Coder" goes a long way toward
making portions of your website available only to those who possess
the correct password.
This Login Coder script is a bit more than the link that you list as
the method of moving into the protected section of the site. This
script uses a form select and a form button, rather than a link, but
is easily understood on the web page, and easily used, all the same.
When we borrow coding from others, sometimes appearance is slightly
compromised. The script is very carefully written to obsfucate
information from the casual user. I don't wish to negate this
protection by changing form elements into simple hidden input fields.
The script is available from the JavascriptSource at Internet.com"
http://javascript.internet.com/passwords/login-coder.html
Instructions on the page (in the textbox) read, in part:
"Create your users, their passwords, and their destination pages using
the form above.
*Honestly, we don't even totally understand this JavaScript!*"
The form they're speaking of shows a list of four users on the left
side. You'll want to highlight each name and press (click) the Delete
User Button. Once all names are deleted, and the left-hand box is
empty, you'll fill in the form to create your site protection
password.
User: Member
Password: xxxxxxxx (your choice, exactly 8 letters (a-z))
Page Name: xxxxxxxx (your choice - the page your members will be
directed to, but its name must have 8 letters)
Once you've entered your choices, select (click) New User. A
javascript textbox will appear asking for a User Name. Member, or any
other generic name will work best.
Now press (click) the Update/Show Coding button.
Your personalized code will be displayed in the large textbox.
Right-click, choose Select All, right-click again, and choose Copy.
You'll Paste the code into the proper spot in your HTML document. I
also recommend opening up a blank document (in Notepad) and saving the
script, as is.
Several lines can be changed to make the script more intuitive for use
with "one password for all". I'll show an example here, but you'll
want to make your changes to -your- copy of the script, rather than
cut and paste my changes. [ and ] are used in place of < and > so that
it will display properly in this answer.
In the script, eliminate the following line:
[ option value = [ 'x' ]
This will insure that only the single line shows in the input box.
You can change the "Member-Only Area!" to anything you might prefer.
You can eliminate the word Username (just erase) if you think that
might be too confusing.
In this line:
type = button value = "Login"
You can change the value to any words you prefer.
Eliminate the following lines/sections from the script:
alert ( "Please Select Your Name From The List" );
return;
and
if ( h1 ! = params [ 1] ) {
alert ( "Incorrect Password!" ) ; return; };
Once you've placed the script where you like it on the page, and saved
the page, simply upload the file again.
Make sure the page you wish to redirect to is named exactly as you
specified in the Upload Coder -- an 8 letter name. If you selected the
page name members1, the actual page should be named members1.html.
Here is a sample of the script, with the changes I've outlined above.
The password is: okeydoke - the password protected page is named
hideit4u.html.
http://68.15.21.151/uploads/researchers/hideit4u.html
Search Strategy
----------------------------------------------------------------------
Google Search Terms
javascript password protection
I hope this solution meets your requirements. If anything is unclear,
or if you need further instructions, or have questions about the
script or the solution, please, feel free to ask for Clarification and
I will be happy to assist you further.
---larre |
Clarification of Answer by
larre-ga
on
23 Jun 2004 12:13 PDT
My apologies. Give it another try.
The Coder -only- allows characters for all names. No numbers. I used a
number in the naming of the hidden file, which the script encoder
changed to the letter "z". I have changed the name of the "hidden"
page, and the script works correctly. I'd initially tested on my own
system, then went through the process again, using the Code Generator
to make another copy of the script, choosing fancier names for a
sample. The hidden page the cript was actually seeking was named
"hideitzu.html". Going, with the flow <grin>, I re-uploaded a page
with that name to correct the problem. I've re-tested with several
different browsers to make sure it works correctly.
---l
|