The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Log In Code

View previous topic View next topic Go down

Log In Code

Post by PorkyPine V10 on August 6th 2012, 11:20 pm

how do i make this login code work

Code:
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function LogIn(){
loggedin=false;
username="";
password="";
username=prompt("Username:","");
username=username.toLowerCase();
password=prompt("Password:","");
password=password.toLowerCase();
if (username=="guest" && password=="login") {
loggedin=true;
window.location="forum";
}
if (username=="guest2" && password=="login2") {
loggedin=true;
window.location="/forum";
}
if (loggedin==false) {
alert("Invalid login!");
}
}

</SCRIPT>
<BODY>
<center>
<form><input type=button value="Login!" onClick="LogIn()"></form>

</center>
</body>
</html>

PorkyPine V10
Forumember

Male Posts : 387
Reputation : 19
Language : English, Spanish, French, Japanese

http://gfx-creators.forumotion.com/

Back to top Go down

Re: Log In Code

Post by LGforum on August 7th 2012, 2:44 pm

You can't. That's a terrible piece of code, a JavaScript log in is impossible.
This will never work as a log in because there is nothing sent to the server.

What are you trying to do exactly?

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: Log In Code

Post by Inspirational on August 7th 2012, 5:21 pm

Login codes? Logging in pages aren't access-able through this type of script/code. Logging in anything that's not secure not quite safe.

Inspirational
Forumember

Female Posts : 26
Reputation : 1
Language : English
Location : US - maryland

http://www.gamezerclub.com/

Back to top Go down

Re: Log In Code

Post by PorkyPine V10 on August 7th 2012, 6:50 pm

@LGforum wrote:You can't. That's a terrible piece of code, a JavaScript log in is impossible.
This will never work as a log in because there is nothing sent to the server.

What are you trying to do exactly?

oh, im trying to make a login thing for a homepage

PorkyPine V10
Forumember

Male Posts : 387
Reputation : 19
Language : English, Spanish, French, Japanese

http://gfx-creators.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum