inherit
215402
0
May 16, 2024 22:22:16 GMT -8
Tix Mascot
Italy is my second homeland.
340
October 2014
heretix
|
Post by Tix Mascot on Apr 3, 2018 7:19:12 GMT -8
Hi! I am trying to create a code where inserting the correct password into an HTML box on one custom page lets you access another custom page that is otherwise hidden. But my limited coding skills prevent me from succeeding, so I need some expert help here. Thanks in advance!
|
|
#e61919
Support Staff
224482
0
1
May 16, 2024 17:30:11 GMT -8
Scott
23,378
August 2015
socalso
|
Post by Scott on Apr 3, 2018 8:54:38 GMT -8
Tix Mascot , This code should do it for you. <SCRIPT> function passWord() { var testV = 1; var pass1 = prompt('Please Enter Your Password',' '); while (testV < 3) { if (!pass1) history.go(-1); if (pass1.toLowerCase() == "letmein") { alert('You Got it Right!'); window.open("/page/custompage"); break; } testV+=1; var pass1 = prompt('Access Denied - Password Incorrect, Please Try Again.','Password'); } if (pass1.toLowerCase()!="password" & testV ==3) history.go(-1); return " "; } </SCRIPT> <CENTER> <FORM> <input type="button" value="Enter Protected Area" onClick="passWord()"> </FORM> </CENTER>
Customizing the code:
|
|
inherit
215402
0
May 16, 2024 22:22:16 GMT -8
Tix Mascot
Italy is my second homeland.
340
October 2014
heretix
|
Post by Tix Mascot on Apr 4, 2018 6:06:17 GMT -8
Thanks a bunch, Scott, I'll give you feedback when I have tested it and hopefully succeeded.
|
|
inherit
215402
0
May 16, 2024 22:22:16 GMT -8
Tix Mascot
Italy is my second homeland.
340
October 2014
heretix
|
Post by Tix Mascot on Apr 4, 2018 7:59:52 GMT -8
That works like a charm, Scott! Thanks again! I tried to link it to a page on a different forum, but that didn't function, so how can I modify it?
|
|
#e61919
Support Staff
224482
0
1
May 16, 2024 17:30:11 GMT -8
Scott
23,378
August 2015
socalso
|
Post by Scott on Apr 4, 2018 8:26:12 GMT -8
Tix Mascot, on my screenshot above, change the URL in line 10 of the code. window.open("http://support.proboards.com");
|
|
inherit
215402
0
May 16, 2024 22:22:16 GMT -8
Tix Mascot
Italy is my second homeland.
340
October 2014
heretix
|
Post by Tix Mascot on Apr 5, 2018 7:00:25 GMT -8
Awesome, Scott! I tried with www, but forgot about the http://. Now, I have to find useful ways to display my new skills!
|
|