Some Added Extras You May Like
Working With Frames And Other Windows
Anti-Bookmarking Your Members Page
Using Password Only As Login
Back to Multi-User and Destination
1).
Open Members Pages In Frames And Other Windows
After you have entered all your members but before you Copy And Paste the Login Script to your HTML editor, you can make changes to the Login Script In the Text Box. Near the bottom of the Created Login Script you will see the line which does all the page changing: if (choice) top.location=choice.toLowerCase(); ---------------------------------------------- 'top' refers to the Window you are looking at and is the word we need to change. 1). To The Same Frame: change the words 'top.location' to a). this.location b). location c). parent.'framename'.location 'framename' is the NAME of YOUR frame. eg: parent.main.location 1). Open In a Different Frame: a). parent.'framename'.location This is the same as above but 'framename' is ANY frame with a name. So you can load the Login Script into any of your frames and open the Members Pages in any other or the same frame. MEMBERS IN A NEW WINDOW ----------------------- This is more difficult and has many options: + if (choice) top.location=choice.toLowerCase(); becomes + if (choice) + { newloc=choice.toLowerCase(); + window.open(newloc, "members", 'WINDOWFEATURES'); // you may wish to close the login page + this.location="thanks.htm"; }; WINDOW FEATURES: --------------- toolbar[=yes|no] ('toolbar' is same as 'toolbar=yes') location[=yes|no] directories[=yes|no] status[=yes|no] menubar[=yes|no] scrollbars[=yes|no] resizable[=yes|no] width=pixels (full width if not specified) height=pixels (full height if not specified) eg: ...,"toolbar=yes,width=100,height=100,status");
2).
Anti-Bookmarking Your Members Page
window.opener may work better (7th nov 98)
Preventing your members from going straight to the members pages can be done in many ways. The most simple but most unreliable (so I have been informed) is the document.referrer object. In your members page, add this to the top of the html file: 1). (path/login.htm) You can get the EXACT refering document string by temporarily adding this to the top of the members page and then loging on: YOU MUST TEST THIS ON THE INTERNET! The result from your hard drive will be something like: document.referrer = file:/c%3A/design/javascript/login.htm If you want to separate the refering document HTML name: + var ref=document.referrer; // get path and filename + var indx=ref.lastIndexOf("/")+1; // find last '/' + var page=ref.substring(indx,ref.length); // from '/' to end + if (page!="login.htm") location="login.htm"; 2). this/top/parent.framename/.location See above for navigation within frames and to other windows... ==================================== Internet Explorer users: I have had reports and complaints that IE does not show document.referrer. How to get around this? 1). write to microsoft and complain? 2). pass a parameter... + if (choice) top.location=choice+"?abc123".toLowerCase(); This will load the members page with a URL of "...members.htm?abc123" To extract this is easy: + var param=location.search.substring(1,location.search.length); This stores everything after the '?' in the variable 'param' so: + if (param!="abc123") location="login.htm"; "But This Can Be Bookmarked!" you cry... So make a unique param every time I respond! + var today=new Date(); // get the exact date! + document.write(today.getTime()); // get miliseconds! displays: 903845352490 ok, so this is a bit too accurate for internet rates these days. We need to cut the time down. Maybe give the member 10 seconds to get the members page loaded? If we divide the current thousandth of a second since 1/1/1970 (I think) by 10000 we get a count of every ten second. This is adequate but there are lots of decimal points left over so we need to get rid of them: + var today=new Date(); // get the exact date! + var tens=Math.floor(today.getTime()/10000); // tens of seconds Let's put it together: login.htm: ---------- if (choice) { var tdy=new Date(); var tens=Math.floor(tdy.getTime()/10000); var newloc=choice+"?"+tens; top.location=newloc.toLowerCase(); }; members.htm: ------------ var param=location.search.substring(1,location.search.length); var tdy=new Date(); var tens=Math.floor(tdy.getTime()/10000); if (tens!=param) top.location="login.htm"; I am sure there are many more ways to do this. You could set a cookie with some date information in the login.htm and read the cookie from the members.htm. But this whole Login Script Creator was for the express purpose of giving Multiple Members Multiple Destinations. And I did just that.
3).
Using Password Only As Login
A few people have requested only a PASSWORD for the Login.htm page. The Login Script searches for a unique Member Name and then checks the Password. To change everything around would mean re-writing the whole lot. So I have devised a simpler modification but the explanation would take an hour to read so just follow this step by step tutorial: login.htm: ---------- 1)
2) Login Name:
3)
4) Password:
5)
CHANGE TO: 1)
2) PASSWORD:
3)
4) 5)
AND: 0) flag=0; h0=makehash(form.member.value,7); 1) for (j=0;j