?a name="DESCRIPTION" con?="How to build a website,Fre?torials,?ite building,html,javasc??,free ed?,free templates" /> ?ipt type="text/j??t"> function bookmarksi?itle?l){ if (??.all) wi??ernal.Ad????itle); else if (wind?idebar) wind?idebar.addPanel(titl?rl, "") } ?able width="100%" border="0"> ?d rowspan="2">

? class="style1">Web Designing Made Easy

Add to Favo?es ?d valign="top">Tell a Friend ?>

?p;Make YHome Page

?r class=?le1">   ?d width="600" he?="33" align="center" valign="middle" bgc?="#1B5389" c?="topbg"> ?m action?tp://translate.google.co?anslate"?get="_top"> ?d>
??ype=hidden name=u value=?p://www.freewebknowledge.com/ind?hp"> ??ype=hidden name=u value=?p://www.freewebknowledge.com/ind?hp"> ??ype=hidden name=u value=?p://www.freewebknowl.com/ind?hp">
?d> ??ype=hidden name=u value=?p://www.freewebknowledge.com/ind?hp"> ??ype=hidden nu value=?p://www.freewebknowledge.com/ind?hp"> ?ut name="image" type="image" src="Im?/zh-CN.gif" alt="Chinese" width="18" height="12"?ace=2 bo?=0> ?d> ??ype=hidden name=u value=?p://www.freewebknowledge.com/ind?hp">

?m method="get" action="http:??eewebknowledge.com/googlesearch.php"?get="_top">

??ype="hidden" name="l?air" value="?t"> ??ype="hidden" name="l?air" value="en|es"> ?m action?tp://translate.google.co?anslate"?get="_top">
?ut name="image" type="image" src="Im?/ru.gif"??ssia?idth="18" he?="12?pace=2 border=0>

??ype=?t" name="q" size="19" maxlength="255" value="" />
?able>
Web This Site
??ype="hidden" name="clien?alue?b-4054215077021653"> ??ype="hidden" name="cof" ?e="GALT:#F2984C;GL:1;DIV:#376B99;VLC:663399;AH:center;BGC:376B99;LBGC:336699;ALC:FED200;LC:FED200;T:FFFFFF;GFNT:0000FF;GIMP:0000FF;FORID:11"> ? ?able>
? align="?">HTML T?ial

JavaS??torial ? align="?">CSS T?ial

PHP/ASP

CGI Tutorial

? align="?">

Free Web Tools

Free FTP Tool

Free we?es ? ali?">Fre??s

Free Logos ? align="?">T??

Free Web Tools

t color="#FFFFFF">Free JavaScripts

? align="?">

O??vices

Quick L??rong>

Submit a?orial

L?

Free Re?ces

Translate a webpage in ? Language

Earn money wi?our ?ite ? align="?">Free ?���ite Submission

Suggestions

META Tag Generator

HTML En?tor

Check?e Popula?

Search Sug?ion Tool

? Gen?or

?r> Home |?���act Us?act UsFree Re?���ces | ?d rowspan="1" align="center" valign=?" bgcolor="#376B99">

Adding a ?word to ? pag?pan>

? align="?" class="mai?">

OK, I finally got ???iting the javasc????otection?orial. Y?ill see the example script here ???raightfo?d, but i?????y to? around. I'll te??hy and give you links to?e secure???er in th??ial.

CGI Sc? or ask ? web?t to? up an .htpassword file ?ou need ?rote??hing?ortant.

? align="?"> Below is a link that wi?how you an e?le of wh??e about to c?e. Click the link. When you are prompted???ord,?er:

? align="?"> cool?>

E?le P?ord ?ected Page OK, ??yped "cool" into the prompt,??e allowed to con?e loading th?ample page. ??yped?thing else or nothin? all, you we?aken right back ?his page. That i?? cool. Now l? see the?ipt ? mak?his work. You would place th??t in the HEAD section of the page? want to pro?. In this case, ?as "jex8?". Here ???t:

<HEAD>
<SCRIPT language="JavaS?t">
<!--hide
???d;

var ?1="cool"??ord=prompt('Please e??r passwo?o vi?his page!',' ');

if (password==?1)
  alert('?word??! Click ?o enter!');
else
   {
    wi?.location="http:??eewebknowledge.com/jscript/j??";
 ?

//-->
</SCRIPT>?;/HEAD>

?ou have been?ough the pre??torials,?t of the code will make ?e to?. Let's get ?he details of what is going ?ith ? thing:

? align="?"> var ?word;

? align="?"> var ?1="cool"; This c?es a??d th?ill be a?ted ???t. We name it pass1 in case ?ould like to?e mo?han one acceptab??ord. ( ie pass2,?s3 etc. ).

??ord=prompt('Please e??r passwo?o vi?his page!',' ');? /> This is what c????t for th??o enter a password. ?? the user en? in the prom?ill ??alue of the variable "password". If you have? see??s before, go to the prompts tutorial??e info.

? align="?"> if (?word==pass1)? /> alert(??d Correct! Click OK to e?!');? /> This is where ?erify the password. The variable "password" ?hat the ???ped into the prompt. The?iabl?ass1? the only passwo?e will a?t. If they a??ame, we send them an ale?hat the ?word? OK and ? can con?e. If you haven't seen if/el?tate?s yet, go to the if/else page. For more on a???he a?s page.

? align="?"> else? /> {
window.location?tp:/?.freeweb?ledge.co???ass.php";
?

This ?hat ?ens when the?pe in an incorre??ord. We send them to?age of our choice. In IE4, it looks like?hing?pened, i??eloa?page. In NS3 and??ill prob? see the pro??age for ?arter of?econd. I sai??n't the ? secure script o?here, so?ould recomme?he l? at the end ???ial ?ou can get a?e secure?ipt. I chose to send it back to ? page (j??), b?ou c?ype any url here? want. Maybe?????hing like:
Ma?hem cringe a?tle.......

All ?'s left after that is to link to the pro??age from ano? page, like my link ?e to the example. No problem.

Now, ??ant more than one ac?able???ou can make a couple of modifications and you will have it.

? align="?">?st, add more?iables f?he a?ted ?words. If you wa?hree good passwords, dec??aria?. Since I had one named ?s1" already,?ill ? use "pass2" and "pass3":

?> ? align="?">

?e>
              
???ill need to chan?our "if" stateme?o include th?her two ?words. This is done with the || (or) operator:


if (?word==pass1 ??ord=??| password==?3)
  alert('?word??! Click ?o enter!');

? mea?hat ??ser typed in the?? valor "?1" OR "pass2" OR "?3", the ?word is ?ect and ? can view the page.

? align="?">??? the full co?ould look for this:

? align="?">

?e>???d; var ?1="cool"; var pass2="awesome??ass3="ge?oid"??ord=prompt('Please e??r passwo?o vi?his page!',' '); if (password==?????ass2 || ?word==pass3) a?('Password Correct! Click OK to enter!'); else { window.l?ion=?p://www.freewebknowledge.com/jsc?/jpa?hp"; }

If you wa?o see this in action, click the link? thi?ample below.?er one of the three ?ect ?words (cool, awesome? geekazoid) and will see the?t page!

? align="?"> Multiple Password E?le

So, why is it ea?o ha???t? O?ay is for the vi? to disable javascript. Not ? wiley g?o the pa?his way, they can al?iew the ?ce code ????? and use them later.?s, if yo??otecting something i??, you should use something more ?re. You can find some mo??e password j??ts at The JavaScript Source. You can also look? a C??ord script at The CGI Re?ce I?.

Well, that was OK?t if? go ?he next ?ion you will see?lightly ??ersion of th?ame script. So, go on to Password Protectio/a>!

?p;

 

?>
?able> ? align="?er">

?ame src=?/728-15.php" width="728" height="15" framebo?="no" bo?="0"??idth="0"?ginheight="0" scrolling="no">

Home | ?act Us| Links| Pri? Policy

 
 
© ?rights 2007 Free Webknowl ® A??s re?ed ?r>

?ipt language??ipt> var dc_UnitID = 14? dc_PublisherID = 35115;var dc_AdLinkColor = 'gold';var dc_isBol?ive= 'no';var dc?rod='ADL';