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:

<link rel="stylesheet" type="text/css" href=file:///c:/html/web2.css />

<!-- Begin
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. }
// End -->


<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>

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

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.