469,357 Members | 1,719 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Password Problem

I am new to javascript..

i have a made a form simply containing username textfield, the password text field and the submit button..

when the user click on the submit button i want to them to go to a certain url if the password is correct ...

i want the password to be stored in a separate javascript file ....is that possible

plz can anybody teach me how to do it ...
Apr 11 '09 #1
5 1122
Dormilich
8,652 Expert Mod 8TB
I strongly recommend doing the password check on the server. Although there is a possibility to use md5 and sha1 hash functions* (link).

* never store the passwords in plain text, better store its hash value somewhere and compare it with the hashed return of the supposed to be password from the input.
Apr 11 '09 #2
I just don't know how to do that ..could you provide me the code plz
Apr 11 '09 #3
Dormilich
8,652 Expert Mod 8TB
Javascript or server side?
Apr 11 '09 #4
server side .. if its not much trouble for you
Apr 11 '09 #5
Dormilich
8,652 Expert Mod 8TB
basicly it runs like that (I'm using PHP here)
Expand|Select|Wrap|Line Numbers
  1. if ( hash(HASH_TYPE, $_POST['password']) == STORED_PW_HASH )
  2.   // I use 'ripemd256', at least use 'sha256'
  3.   // HASH_TYPE & STORED_PW_HASH may as well be class constants
  4. {
  5.     // do allowed things like setting $_SESSION etc.
  6. }
Apr 11 '09 #6

Post your reply

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

Similar topics

11 posts views Thread by John Victor | last post: by
6 posts views Thread by John Morgan | last post: by
4 posts views Thread by Jonathan Dienst | last post: by
7 posts views Thread by Dino M. Buljubasic | last post: by
6 posts views Thread by Frank L | last post: by
5 posts views Thread by John | last post: by
3 posts views Thread by Noel S Pamfree | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.