User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 429,794 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,804 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 6642 | Replies: 5
Reply
Join Date: Jan 2005
Posts: 2
Reputation: Big Riv is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Big Riv Big Riv is offline Offline
Newbie Poster

Help Password Protection from a txt.file

  #1  
Jan 18th, 2005
I am experiencing a great degree of difficulty trying to password protect a page on my site. I have a .txt file of user id numbers which serve as passwords, and I want to create a java script to gain access that file from my html form. Any help out there?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2004
Posts: 207
Reputation: suRoot is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 8
suRoot's Avatar
suRoot suRoot is offline Offline
Posting Whiz in Training

Re: Password Protection from a txt.file

  #2  
Jan 18th, 2005
it's much much much easier to use an access database.. ive got the asp code for this (you're using cookiebased login sessions yea?) but i would need t find it, ask m again if you acctually want it
NIKE just mod it!


HND Business IT
CCNA
MSCE
Reply With Quote  
Join Date: Jan 2005
Posts: 2
Reputation: Big Riv is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Big Riv Big Riv is offline Offline
Newbie Poster

Re: Password Protection from a txt.file

  #3  
Jan 19th, 2005
OK, I will try using the Access Database.. I could still use your help though. Just let me know what I need to send you and I'll get it done.
Reply With Quote  
Join Date: Jun 2005
Location: Kansas City, Missouri, USA
Posts: 344
Reputation: Troy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: Password Protection from a txt.file

  #4  
Mar 24th, 2006
Password protection can be tackled a lot of different ways and they depend on:
  • Which OS (windows? linux?)
  • Which webserver (IIS? Apache?)
  • Do you have admin privs on the server?
  • Do you only need to protect scripts or all files?
  • What scripting languages are available to you? (ASP?, ASP.NET?, PHP?, Java?, PERL CGI?)
Know that you cannot secure any web page with javascript. You can make a page harder to access for somebody without any HTML/script skills, but not secure.

You mention a text file with the passwords that the javascript will use to verify....um....if your client-side javascript can access the text file, so can your site visitors. All they have to do is open the page source, read the javascript, then point their browser to the text file. Again, not secure.
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 108
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: Password Protection from a txt.file

  #5  
Mar 24th, 2006
Best way is to use a server side language, like Perl or PhP (or ASP), and use it for the authentication...
Reply With Quote  
Join Date: Jun 2005
Location: Kansas City, Missouri, USA
Posts: 344
Reputation: Troy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Help Re: Password Protection from a txt.file

  #6  
Mar 24th, 2006
I don't know that I'd say using a server-side scripting language is the "best" way. You can certainly build a good solution that way. I provide a PHP example for password-protecting pages in my class_session.

I would argue that as far as security goes, using a method natively supported by your webserver is even better than using server-side script. You can configure the webserver to require authentication for specific files or directories. This is done by turning off anonymous access and configuring an authentication method.

For example, with Apache, you can have Apache require the user to authenticate using an OS account, an htpasswd account, or a user account stored in a database. You can enforce this using the Apache conf files or via .htaccess files -- you can search for more about .htaccess.

With server-side script, typically you can only protect script. For example, if you have a directory full of PDF's, it's not so easy to protect those with server-side script. There IS a way, but it involves storing the PDF's in a non web-accessible directory and having a script that can open and stream the PDF--if the user is authorized.

It really depends on what your goals are, what your platform is, and what skill resources you have available.
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb HTML and CSS Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 4:31 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC