Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 05-29-2009, 04:00 PM   #1 (permalink)
Contributing Member
 
Join Date: 03-25-06
Location: Galax, Virginia, USA
Posts: 157
iTrader: 0 / 0%
Latest Blog:
None

Brazzell Marketing is liked by somebodyBrazzell Marketing is liked by somebodyBrazzell Marketing is liked by somebodyBrazzell Marketing is liked by somebodyBrazzell Marketing is liked by somebody
Need html for Password Protected Page

Here's a great javascript for password protecting a page, but I need a better one. Can anyone help?

What I am using now is:

<script language="JavaScript">
<!--hide
var password;
var pass1="LetMeIn";
password=prompt('Enter your password to view page.',' ');
if (password==pass1)
{ location="http://www.Password-Protected-Page.html" }
else {
window.location="http://www.WrongAnswer.com";
}
// end hide--> </script>



It's not terribly secure, but all I want to do is keep out the lookyloos. The problem is that too many of the people I want to use this page have JavaScripts disabled on their browsers, and it's too hard telling each of them how to find and fix this on their respective browsers. I was wondering, is there a way to do something similar with a standard html form? If I can cut and paste some code like this, I would love that. If I have to create a database on my server, I'll just hire someone to build the security for this site. Feel free to PM me if you want to quote building the security feature.
__________________
Gary Brazzell / Brazzell Marketing Agency
Be First in the Minds of Your Customers!
Physical Therapy Marketing / Home Health Care Marketing
Brazzell Marketing is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-29-2009, 04:13 PM   #2 (permalink)
Moderator
 
Hades's Avatar
 
Join Date: 01-23-07
Location: Buenos Aires, Argentina
Posts: 1,250
iTrader: 0 / 0%
Hades is a web professional of the highest orderHades is a web professional of the highest orderHades is a web professional of the highest orderHades is a web professional of the highest orderHades is a web professional of the highest orderHades is a web professional of the highest orderHades is a web professional of the highest orderHades is a web professional of the highest orderHades is a web professional of the highest orderHades is a web professional of the highest orderHades is a web professional of the highest order
You should not use HTML/Javascript for password protection.

Do you have console access to the server? you can set up a .htaccess file to do a very basic password protection without doing any DataBase work. Follow this guide and it could take you about 10 minutes.

If you need help to do it just ask.

Regards.
__________________
Hades,
Ancient god, King of the Nether World, and Guardian of the Dead.
...and on my free time I'm also a web developer, contact me if you need one!
Hades is online now  
Add Post to del.icio.us
Reply With Quote
Old 05-29-2009, 06:21 PM   #3 (permalink)
Meeow!
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 3,235
iTrader: 0 / 0%
Latest Blog:
None

Costin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest order
Hades is right here. Never, and I mean NEVER, use javascript to password protect a page.

You'd have no way to prevent a user from getting that password from your script. Even if encrypted, yes. Unless you develop your own encryption algorithm, but I doubt you want to go there
__________________
...to be continued
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-29-2009, 10:14 PM   #4 (permalink)
Super Moderator
 
htmlbasictutor's Avatar
 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 3,275
iTrader: 0 / 0%
Latest Blog:
Website Testing

htmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web prohtmlbasictutor is a highly respected web pro
What if the user has scripting turned off?
__________________
HTML Basic Tutor - Learn to code your web pages/blogs
Basic Computer Information - Computer Basics for website owners

Trouble getting indexed? Maybe it's something techincal - Pm me.
htmlbasictutor is online now  
Add Post to del.icio.us
Reply With Quote
Old 05-30-2009, 09:08 AM   #5 (permalink)
Contributing Member
 
Join Date: 04-21-08
Posts: 101
iTrader: 0 / 0%
Latest Blog:
None

Betmenko is liked by many
Quote:
Originally Posted by Costin Trifan View Post
Hades is right here. Never, and I mean NEVER, use javascript to password protect a page.

You'd have no way to prevent a user from getting that password from your script. Even if encrypted, yes. Unless you develop your own encryption algorithm, but I doubt you want to go there

yep only if he thinks of making ajax login but this is completely different.
javascript password can break 90% of internet users
Betmenko is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-30-2009, 09:39 AM   #6 (permalink)
Meeow!
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 3,235
iTrader: 0 / 0%
Latest Blog:
None

Costin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest order
An ajax login system would most of the time require some server-side backend so it wouldn't be only javascript anymore; just like you said, it would be completely different.
__________________
...to be continued
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-01-2009, 07:37 AM   #7 (permalink)
Contributing Member
 
Join Date: 03-25-06
Location: Galax, Virginia, USA
Posts: 157
iTrader: 0 / 0%
Latest Blog:
None

Brazzell Marketing is liked by somebodyBrazzell Marketing is liked by somebodyBrazzell Marketing is liked by somebodyBrazzell Marketing is liked by somebodyBrazzell Marketing is liked by somebody
Thanks, Hades. I think that is what I was looking for.

The javascript that is there now is the equivalent of one of those little locks on a desk drawer. It says "stay out," but anyone with bad intentions could jerk it open if they really tried. We understood that when we put it in place. We would have been happy with the low level of security for the non-sensitive materials we had on the page, but the javascript is turned off on just too many browsers. Hades option looks much better going forward. Thanks again.
__________________
Gary Brazzell / Brazzell Marketing Agency
Be First in the Minds of Your Customers!
Physical Therapy Marketing / Home Health Care Marketing
Brazzell Marketing is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
unwanted password protected website cgillis73 Coding Forum 18 06-12-2008 02:24 PM
Password Protected? John Scott Tech Support Forum 33 09-08-2007 02:21 PM
Password Protected Area Help Please aleshawaterfall Coding Forum 1 11-17-2006 08:28 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 02:46 PM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.