My password script no longer works. |
My password script no longer works. |
ReBoot |
Sep 25 2009, 03:56 PM
Post
#1
|
Group: Members Posts: 2 Joined: 25-September 09 Member No.: 9,858 |
The web page I'm working with uses <input type="button" value="View volunteer news" onClick="passWord()"> to prompt for a password and if it's correct go to a specific web page. It has worked for years, but now does not prompt for the password anymore.
I'm a novice at this. Here is the code... <script> function passWord() { var testV = 1; var pass1 = prompt('Please Enter Your Password',' '); while (testV < 3) { if (!pass1) history.go(-1); if (pass1.toLowerCase() == "laura") { //alert('You Got it Right!'); window.open('volunteer_news_a.html'); break; } testV+=1; var pass1 = prompt('Access Denied - Password Incorrect, Please Try Again.','Password'); } if (pass1.toLowerCase()!="laura" & testV ==3) history.go(-1); return " "; } </SCRIPT> <input type="button" value="View volunteer news" onClick="passWord()"> I know it is not very secure since the password is in the code, but that is fine with the user. Any help would be appreciated. Let me know if you need more info. Here is the page involved. http://www.natures-nursery.org/volunteers_only.html |
Darin McGrew |
Sep 25 2009, 04:17 PM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
I'm moving this to the Client-side Scripting forum.
|
pandy |
Sep 25 2009, 05:24 PM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,732 Joined: 9-August 06 Member No.: 6 |
Seems you copied the code above from some place where it's still intact because it works.
|
ReBoot |
Sep 27 2009, 09:35 AM
Post
#4
|
Group: Members Posts: 2 Joined: 25-September 09 Member No.: 9,858 |
Seems you copied the code above from some place where it's still intact because it works. I copied the code right from the page http://www.natures-nursery.org/volunteers_only.html Here is the home page. http://www.natures-nursery.org/index.html If I click on the menu option "Volunteer News" and then the "View volunteer news" button it just takes me back to the home page. It use to work and I have made no change to the code. Could it be affected by the uses Internet options? Donald I have found away around the problem. Thank you! This post has been edited by ReBoot: Sep 27 2009, 10:18 AM |
pandy |
Sep 27 2009, 02:40 PM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,732 Joined: 9-August 06 Member No.: 6 |
I'm promted for the password and after I've entered the right one I'm taken to volunteer_news_a.html . If I enter the wrong password, after three tries I'm redirected back to the home page, if there's where I came from.
|
Lo-Fi Version | Time is now: 26th April 2024 - 09:57 PM |