954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Password protect code

I got this script from JavaScript Kit.com. The script refers to entering a userid and password to access one page. I have multiple acquaintances with each getting their own userid and password (it doesn't matter that it isn't encrypted). I am making one page that has the script on it. I would like to modify the code to receive various userid/password combinations to access respective pages.

The original code:

jeremiah sky
Newbie Poster
1 post since Jul 2007
Reputation Points: 10
Solved Threads: 0
 

Never ever use javascript top password protect pages. Getting around it is as easy as turning javascript off or just viewing the source code. Use server side password protect like Basic Authentication through .htaccess or a server side programming language like PHP.

stymiee
He's No Good To Me Dead
Moderator
3,360 posts since May 2006
Reputation Points: 161
Solved Threads: 38
 

They said encryption was not an issue. So just to answer the question, yes, you are going in the right direction. Just check on those braces if it is not working correctly.

sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
 

Encryption or not you can still unencrypt it or turn javascript off to defeat it. JavaScript password protection is always a bad idea.

stymiee
He's No Good To Me Dead
Moderator
3,360 posts since May 2006
Reputation Points: 161
Solved Threads: 38
 

I am not disputing that fact. ;)

sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
 

you have any idea where i learn PHP first time?
I have only HTML idea

jishu
Newbie Poster
3 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 
stymiee
He's No Good To Me Dead
Moderator
3,360 posts since May 2006
Reputation Points: 161
Solved Threads: 38
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You