Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display drive driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Password entry for site


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
2141660's Avatar
Junior Member with 5 posts.
 
Join Date: Oct 2005
Location: Nashville, TN
Experience: Beginner
27-Jan-2006, 01:20 PM #1
Solved: Password entry for site
Greetings!

I have built a simple website using Dreamweaver. I know enough HTML to be able to fix things, and I can get around Dreamweaver a bit. At this time, the company feels it would be smart to put a password entry on the site to protect a new technology that they are developing. Is this a hard thing? Should I hire someone with bigger brains? or is there somewhere I could be pointed? The company only needs one username/password that all approved associates could use, and they could change relatively often.

Thanks-
2141660
Squashman's Avatar
Distinguished Member with 12,689 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
27-Jan-2006, 01:23 PM #2
What Web Server are you using (IIS or Apache)? Is the server yours or is this a hosted site?
2141660's Avatar
Junior Member with 5 posts.
 
Join Date: Oct 2005
Location: Nashville, TN
Experience: Beginner
27-Jan-2006, 04:53 PM #3
Site is hosted on godaddy.com. Holy cow! They may not even allow it on a cheapie site (free). I'll see if it says anything...
2141660's Avatar
Junior Member with 5 posts.
 
Join Date: Oct 2005
Location: Nashville, TN
Experience: Beginner
27-Jan-2006, 05:50 PM #4
Checked with godaddy.com. They say it is possible to use Javascript to put a simple, non-secure password protection in place. They pointed me to Apache's website. I get to learn something new.
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,192 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
27-Jan-2006, 06:15 PM #5
Quote:
Originally Posted by 2141660
Checked with godaddy.com. They say it is possible to use Javascript to put a simple, non-secure password protection in place. They pointed me to Apache's website. I get to learn something new.
And that's the main problem with using JavaScript to password protect a page. Anyone with the slightest knowledge of how to view a pages source code can easily get the password and gain access.
Also, if someone doesn't have JS enabled on their browser, then they see the "password protected" page anyway

Using JavaScript to password protect something is NOT a good idea. Instead try .htaccess and/or .htpasswd

(info of both can be found on the Apache website)

If you want to use JavaScript (which I highly recommend you stay away from) here is some code:

Code:
<script type="text/javascript">
<!--
var password;
var pass1="yourpasswordhere";
password=prompt('Enter your password in order to view this page!',' ');
if (password==pass1) {
alert('Password correct, access granted');
}
else
{
window.location="http://www.example.com";
}
//-->
</script>
__________________
-----------------------------
| 404: Name Not Found |
-----------------------------
PLEASE NOTE: If I happen to help you in a post, or just simply reply to it, doesn't mean I want to be bombarded with PMs. I answer all questions in posts, not in PMs. Thank you, and have a good day.

<?php $h = 'Hello '; $w = 'World'; echo $h.$w; ?>

My Favorite Editors:
Windows: Crimson Editor
Mac: Taco HTML Edit
Linux: gPHPEdit

Last edited by namenotfound : 27-Jan-2006 06:33 PM.
2141660's Avatar
Junior Member with 5 posts.
 
Join Date: Oct 2005
Location: Nashville, TN
Experience: Beginner
27-Jan-2006, 07:28 PM #6
Well- I read further and realized that we had the Economy plan that did not support Java script. What I have done is to post a homepage with no links, that states that a password is required and to contact a company representative with a phone number. I have put the "real" homepage under a different filename. In order to see the site, you have to enter the longer address.
I suppose that the search engines will still find it, but we plan to change the file name often. Do you see any huge blunders in this strategy? It is meant to be a temporary dodge, not a long term solution.
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,192 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
27-Jan-2006, 07:50 PM #7
JavaScript is a client-side scripting language. Your host should have nothing to do about it.
I see no reason why you can't run JavaScript on your Economy plan.

You can use JavaScript on even free hosts (like Geocities), because like I said before hosts can't control JS since it's a client-side language. JS is only dependant on your browser supporting JS.
__________________
-----------------------------
| 404: Name Not Found |
-----------------------------
PLEASE NOTE: If I happen to help you in a post, or just simply reply to it, doesn't mean I want to be bombarded with PMs. I answer all questions in posts, not in PMs. Thank you, and have a good day.

<?php $h = 'Hello '; $w = 'World'; echo $h.$w; ?>

My Favorite Editors:
Windows: Crimson Editor
Mac: Taco HTML Edit
Linux: gPHPEdit
Squashman's Avatar
Distinguished Member with 12,689 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
27-Jan-2006, 09:42 PM #8
I believe GoDaddy uses Apache, so a simple htaccess and htpasswd file will suffice. Just google search for GoDaddy and htaccess
Eriksrocks's Avatar
Computer Specs
Senior Member with 1,859 posts.
 
Join Date: Aug 2005
Location: Minnesota
Experience: Advanced
29-Jan-2006, 04:57 PM #9
To simplify things, use the .htaccess Authentication Generator and the .htpasswd Generator.
2141660's Avatar
Junior Member with 5 posts.
 
Join Date: Oct 2005
Location: Nashville, TN
Experience: Beginner
08-Feb-2006, 09:25 PM #10
Smile And this is why I love you!
Greetings!

I read all this stuff on the .htaccess and .htpasswd files, but I couldn't make it fit together right and work. I chose to go into denial and work on my taxes instead...how warped is that? And then this lovely Mr. Eriksrocks posted a little note.... I had to read a lot more, and try several things, but I got it to work and the CEO is so happy! Thank you for the patience to keep trying to help.

You are the Best!
Eriksrocks's Avatar
Computer Specs
Senior Member with 1,859 posts.
 
Join Date: Aug 2005
Location: Minnesota
Experience: Advanced
09-Feb-2006, 06:37 PM #11
Glad I could help. If your problem is solved, you can mark the thread solved by using the Thread Tools menu.

Thanks.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:46 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.