By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,287 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,287 IT Pros & Developers. It's quick & easy.

Login and registration for my site help??

P: 1
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
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
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.