468,484 Members | 1,567 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,484 developers. It's quick & easy.

Login and registration for my site help??

Im trying to make a personal website with a log in/registration system. I found some help with the log in and now i just need some help with the registration. This is the coding im already using:

[HTML]<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 STRICT//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<HEAD>
<link rel="stylesheet" type="text/css" href=file:///c:/html/web2.css />
<SCRIPT LANGUAGE="JavaScript">


<!-- Begin
[/HTML]
Expand|Select|Wrap|Line Numbers
  1. function Login(){
  2. var done=0;
  3. var username=document.login.username.value;
  4. username=username.toLowerCase();
  5. var password=document.login.password.value;
  6. password=password.toLowerCase();
  7. if (username=="member1" && password=="password1") { window.location="homepage.html"; done=1; }
  8. if (username=="member2" && password=="password2") { window.location="page2.html"; done=1; }
  9. if (username=="member3" && password=="password3") { window.location="page3.html"; done=1; }
  10. if (done==0) { alert("Invalid login!"); }
  11. }
[HTML]
// End -->
</SCRIPT>
</head>

<BODY>

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

what i want to do is add another form with username/password just like the last one except when you push the button i want it to add username/password values for the function to use. I dont even know if this is even possible. I dont really know java, im learning visual basics right now.
Nov 4 '07 #1
1 1525
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

This should be done on the server-side. I can see the valid usernames and passwords and easily login. With server-side code, this validation code would not be seen and is more secure.

Which server-side language (if any) are you using?
Nov 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by John | last post: by
1 post views Thread by Wayne Smith | last post: by
9 posts views Thread by Ben | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.