Need some help with multi user login

  • 1
  • Question
  • Updated 10 years ago
  • Answered
Hello,

I have been searching GS and so far found nothing. So, I would like to know if anyone is using a password protect script with multi-user login that they have on there website. I have one but for some reason cannot seem to get it to work.

<!--
<!-- 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="http://www.teamironblood.org/test1.php"; done=1; }
if (username=="member2" && password=="password2") { window.location="http://www.teamironblood.org/test2.php"; done=1; }
if (username=="member3" && password=="password3") { window.location="http://www.teamironblood.org/test3.php"; done=1; }
if (done==0) { alert("Invalid login!"); }
}
// End -->

<!-- STEP TWO: Paste this code into the BODY of your HTML document -->

Members-Only Area!
Username:
Password:

-->

if you would like to see the problem I'm having: http://www.teamironblood.org/3.php

the only way to login is to hit the enter key, but that doesn't work. So what do I have to change?

Thanks-Dan
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes

Posted 10 years ago

  • 1
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Just bringing it back to the 1st page in case some people didn't get a chance to look at it. The problem that I'm having is nothing happens when I click the LOGIN button. When I hit enter it creates it's own url like: http://www.teamironblood.org/3?userna...

any ideas?

Thanks-Dan
Photo of Emmy

Emmy

  • 5892 Posts
  • 299 Reply Likes
Hi there,

It doesn't look like anyone is familiar with how to do this, I'm sorry. Possibly someone will still jump in with an idea.

Emmy
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hi lambofgod

I don't know how you are putting the code into your site and if this suggestion will make any difference.

I noticed that you have a "head" script and a "body" script. Try to put the "head" script into an HTML widget of its own. Then place this widget up high on your page. Then, take your body part and paste that into another html widget and place where you want it to show up on your page.
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Hey guys, well I got the code working. I would like to ask though is there anything I can put in for when the user hits "ENTER" it logs in. When someone does hit "ENTER" it creates a new url. The user actually has to click on the "LOGIN" button. Any idea?

Thanks-Dan