Log In · Register

 
making your blog private, i need helppppp.
bel_oubli
post Jul 3 2004, 05:54 PM
Post #1


ok, i'm a newbie. shutttt upp.
*

Group: Member
Posts: 6
Joined: Jun 2004
Member No: 19,700



ok, i found a few codes for private blogging, and tried to combine them. i was trying to make a code that would ask you for a password if you were not on a list of users allowed in the blog. the problem is, the stupid code asks everyone for the password, whether they're on the list of accepted users or not. can anyone help me??? i'm thinking one of the problems might be that i have too many usernames that i want to be accepted. agh, help! (and i'm a newbie, so i'm extremely ignorant when it comes to html..)

my code is as follows.

QUOTE
<script>

var allowed = new Array(
"username1",
"username2",
"username3",
"username4",
"username5",
"username6",
"username7",
"username8",
"username9",
"username10",
"username11",
"username12",
"username13",
"username14",
"username15",
"username16",
"username17",
"username18",
"username19",
"username20",
"username21",
"username22",
"username23"
)

var links = document.getElementsByTagName('a');
name="";

for(i=0;i<links.length;i++)
{
if(links[i].innerText.match(/xanga/i) && links[i+2].innerText.match(/sign out/i)){
i++;
if(links[i].href.match('/private/home.aspx') || links[i].innerText.match('join')){
name = links[i].innerText.toLowerCase();
break;

}
}
enter=false;

for(j=0;j<allowed.length;j++)
{
users = allowed[j];
if(users.indexOf(name)==0 && users.length==name.length){
enter=true;
break;
}
}

if(enter!=true){
<!--hide
var password;
var pass1="PASSWORD HERE";

password=prompt('enter password.',' ');
if (password==pass1)
alert('correct password');
else
{
window.location="www.xanga.com";
}
//-->
}
</script>
 
 
Start new topic
Replies (1 - 1)
i ami_am
post Jul 3 2004, 06:03 PM
Post #2


RRRRRr (I) AAAAAA NNNNN
*****

Group: Member
Posts: 469
Joined: Jun 2004
Member No: 24,214



i really have no clue but it seems useful just ask a mod
 

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: