Click to See Complete Forum and Search --> : Help With Logins


icebreaker3d
04-09-2004, 06:10 PM
I got this source code for a login, but the password and the user name are both visable. I don't mind the username showing but i don't want the password to show, thats the reason i want a login :D , here is the code.

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="member1" && password=="password1") { window.location="page1.html"; done=1; }
if (username=="member2" && password=="password2") { window.location="page2.html"; done=1; }
if (username=="member3" && password=="password3") { window.location="page3.html"; done=1; }
if (done==0) { alert("Invalid login!"); }
}
// End -->
</SCRIPT>


<BODY>

<center>
<form name=login>
<table width=225 border=1 cellpadding=3>
<tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr>
<tr><td>Username:</td><td><input type=text name=username></td></tr>
<tr><td>Password:</td><td><input type=text name=password></td></tr>
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
</table>
</form>
</center>




Any help would be GREATLY helpful!

steelersfan88
04-09-2004, 06:21 PM
well, i have developed a simple script that allows you to encode (not by all means encrypt) user names and passwords. The links are below:

UserNames and Passwords: http://js-articles.8m.net/up.htm
Locations: http://js-articles.8m.net/loc.htm
Overall: http://js-articles.8m.net/scr.htm

Create a user name, password, and location for each user to add, making sure to copy everything and note which is which. Paste all this data into the desired locations in the overall page. Open to ?s as this is confusing to work with. (coming soon, add all usernames, passwords, and locations automatically :)! That will be in my profile when I decide to do it.)

Remember,most client side solutions are not at all secure (Jeff has introduced a pretty good algoritm on this though).

icebreaker3d
04-09-2004, 06:33 PM
Thanks man.

This looks better then the idea i had :eek:

Paul Taverner
04-10-2004, 07:02 AM
Hi steelersfan88

Is it possible to declare a target frame for the allowed page in your code?

var webPage = "mySuccessPage.htm"

You may just be able to solve a headache I have!

Kind regards

Paul

steelersfan88
04-10-2004, 07:43 AM
those are fake at the top, just to keep young internet pirates guessing :). That page should be made, but have a message telling the user they must login first. If you want a target, change the line: window.location = loc[i].join(',').decrypt(send.join(','))to window.open(loc[i].join(',').decrypt(send.join(',')),'_target','features')If you want it to open in the same window, use target: _self, new window, use _blank.

Good idea for that though, I will allow you to choose that in my new script that does it all for you :)

Paul Taverner
04-10-2004, 09:13 AM
Thanks for your swift answers to both my questions. You can tell I'm a total novice at scripts can't you :-) Just a humble teacher trying to make some sense of the world!

I look forward to your all-in-on script. You'll be sure to post an announcement .

Rgds

Paul

Paul Taverner
04-10-2004, 09:20 AM
Thanks for your swift answers to both my questions. You can tell I'm a total novice at scripts can't you :-) Just a humble teacher trying to make some sense of the world!

I look forward to your all-in-on script. You'll be sure to post an announcement .

Rgds

Paul

steelersfan88
04-10-2004, 09:20 AM
I am working on it now :) just a small distraction to deal with first

Paul Taverner
04-10-2004, 10:09 AM
Sorry about the dual post.. not sure what happened there:confused:

P

steelersfan88
04-10-2004, 10:51 AM
me either, didn't even notice it...

...well it is finished, the automatic password encoder: http://js-articles.8m.net/allinone.htm

hope you all like, it works like a beauty :)

icebreaker3d
04-10-2004, 11:16 AM
Awesome man, this works PERFECTLY!!!
I was having bits of trouble with having the password accept before. But now it's perfect. :D Thanks a lot:D

steelersfan88
04-10-2004, 11:21 AM
its my second job, glad to help out. Hope that others try it out as well and give feedback on it :)