![]() |
Зарытый раздел сайта
Можно ли сделать так, чтобы например в один из разделов сайта могли зайти не все посетители сайта, а только те которым я разрешу, (указать в скрипте их логин и пароль)
|
<!-- START OF SCRIPT -->
<SCRIPT LANGUAGE="JavaScript"> <!-- Hide from JavaScript-Impaired Browsers al="`1234567890-=~!@#$%^&*()_+qwer" +"tyuiop[]QWERTYUIOP{}|asdfghjkl;A" +"SDFGHJKL:zxcvbnm,./ZXCVBNM<>?"; ab1=""; bctr=0; function ckPwd(){ tst=document.isn.username.value +"*"+document.isn.passwrd.value+"*"; ls=document.pd.pe.value; a=eval(ls.substring(0,2))-91; ls=ls.substring(2,ls.length); nls=""; flg=0; while (ls.length>12){ ab=eval(ls.substring(0,2))-89; ab1=(ab1==""?""+ab:ab1); oab1=ab1; ls=ls.substring(2,ls.length); for (var i=0;i<ab;i++){ nr=eval(ls.substring(0,2))-a; ls=ls.substring(2,ls.length); nls+=al.charAt(nr); } nls+="*"; if (nls.indexOf(tst)>-1){ ls=""; flg=1; } } if (flg==1){ tstOk(); } else{ bctr++; if (bctr>3){ /* Be sure to put the name of the page here to which you want visitors to be sent if they FAIL to enter a correct password and user name after three tries. */ location.href="wrongpage.htm"; } else{ alert("Sorry. Bad Username or Password." +" Failed Attempt #"+bctr+"."); } } } function tstOk(){ ab1=ab1+""+a; alert("OK. You Entered a Valid Username and Password, " +document.isn.username.value+"! Taking you to the" +" restricted page as soon as you click OK."); location.href="pwdss.htm?"+ab1; } function srand() { today=new Date(); rand=today.getTime(); picker=""+rand picker=picker.charAt((picker.length-4)); rec=eval(picker); } // End Hiding --> </SCRIPT> </HEAD> <BODY BGCOLOR="black" text="white"><CENTER> <FORM NAME="pd"> <!-- IMPORTANT: After you run the pseudo-encrypter, you will get a "hidden" form element constructed especially for your own user names and passwords. Paste that form element right below this note and above the end of form tag. --> </FORM> <!-- You may put any page content you wish here The HTML below for the password entry is presently set for blue background and white type. You may change colors to fit your own page design without impacting on the script, so long as the form elements stay the same. --> <FORM NAME="isn"> <TABLE BORDER=2 CELLPADDING=5 CELLSPACING=0 BGCOLOR=BLUE> <TR><TD COLSPAN=2 ALIGN=CENTER><FONT SIZE=4 COLOR=WHITE FACE="helvetica,arial,geneva"><B>Password Access<BR>to Our Restricted Pages</B></FONT></TD></TR> <TR><TD><FONT SIZE=3 COLOR=WHITE><B>Your User Name:</B></FONT></TD> <TD><INPUT TYPE="text" NAME="username" VALUE="" SIZE=10></TD></TR> <TR><TD><FONT SIZE=3 COLOR=WHITE><B>Your Password:</B></FONT></TD> <TD><INPUT TYPE="password" NAME="passwrd" VALUE="" SIZE=10></TD></TR> <TR><TD COLSPAN=2 ALIGN=CENTER><INPUT TYPE="button" NAME="btn" VALUE=" Submit " onClick="ckPwd();return false;"></TD></TR> </TABLE></FORM> <b>To Recieve Access:</b><br> Username- John<br> Password- 4$3gb%a <SCRIPT LANGUAGE="JavaScript"> <!-- Hide JavaScript from Java-Impaired Browsers /* This little script at the bottom of your page isn't strictly necessary, but it does put the visitor's cursor in the password form. It's a small, but polite and thoughtful thing to do for your visitors. */ document.isn.username.focus(); // End Hiding --> </SCRIPT> <!-- END OF SCRIPT --> |
Цитата:
Цитата:
Код:
|
DALA$$
Этот скрипт не работает в Opera 8.5? KEZ скрипт на php не подходит т.к. сайт находится на narod.ru |
Цитата:
|
А нахер спрашивать, если на народе?
|
Цитата:
видишь как получается скрипт на javasript'e, опера держит javascript. javascript=javascript, следовательно работает! ч.т.д. |
А если отключить джаваскрипт? (f12)
ы? |
Все я разобрался все работает.
Всем спасибо |
А кто знает как сделать чтобы в этом скрипте пароль был не один, а несколько?
<!-- BODY START HERE --> <script language="JavaScript"> if (top.location.search=="") { pass = prompt('Введите пароль'); if (pass=='pass') { alert('Пароль принят') } else { alert('Пароль непринят!'), top.location.href="errorpas.htm" } }; </script> </body> |
| Время: 17:52 |