School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,479 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,753 people online right now. Registration is fast and FREE... Join Now!




Login Script

 

Login Script, Creating Website login form

MikeP21442

22 Jun, 2009 - 01:12 AM
Post #1

New D.I.C Head
*

Joined: 12 Jan, 2009
Posts: 14


My Contributions
Hi there!

I know the best way to do this would be PHP database back end, but I haven't got one, so i am trying to get it working through JavaScripting.

I have used the following script for the logon:

CODE
<form>
<p class="style2">Username :
  <input type="text" name="text2">
</p>
<p><span class="style2">Password :</span>
<input type="password" name="text1">
  <input type="button" value="Login" name="Submit" onclick=java script:validate(text2.value,"Mike",text1.value,"Password") >
</p>

</form>
<script language = "javascript">

function validate(text1,text2,text3,text4)
{
if (text1==text2 && text3==text4)
load('21442.html');
else
{
  load('unavailable.html');
}
}
function load(url)
{
location.href=url;
}
</script></p>


This works fine, but it only works for one user. Could someone help me with a way of having several different users/usernames using the above code?

Cheers,

Mike

User is offlineProfile CardPM
+Quote Post


noorahmad

RE: Login Script

22 Jun, 2009 - 01:19 AM
Post #2

Webmaster
Group Icon

Joined: 12 Mar, 2009
Posts: 2,018



Thanked: 125 times
Dream Kudos: 1350
My Contributions
For Multi Users You Must Have a back end and javascript is Client Side Programming, You Can't do it by Javascript, you need a server side language. if you want to know then check Tutorial Section.

smile.gif
User is offlineProfile CardPM
+Quote Post

MikeP21442

RE: Login Script

22 Jun, 2009 - 01:23 AM
Post #3

New D.I.C Head
*

Joined: 12 Jan, 2009
Posts: 14


My Contributions
Ok, thanks for the Reply. I shall have to find another way around! sad.gif
User is offlineProfile CardPM
+Quote Post

noorahmad

RE: Login Script

22 Jun, 2009 - 01:26 AM
Post #4

Webmaster
Group Icon

Joined: 12 Mar, 2009
Posts: 2,018



Thanked: 125 times
Dream Kudos: 1350
My Contributions
QUOTE
Ok, thanks for the Reply. I shall have to find another way around! sad.gif


Ahh, Don't be Sad Dear, this is want no one can't do it. and try to learn a server side Language, wink2.gif
User is offlineProfile CardPM
+Quote Post

forest51690

RE: Login Script

22 Jun, 2009 - 07:12 AM
Post #5

D.I.C Head
Group Icon

Joined: 20 Mar, 2009
Posts: 115



Thanked: 17 times
Dream Kudos: 50
My Contributions
Also, validating a password only with JavaScript is a gaping security hole, because JavaScript is completely visible to the user. If they know JavaScript, then they can get past it.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 03:42AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month