Password Protection from a txt.file

Reply

Join Date: Jan 2005
Posts: 2
Reputation: Big Riv is an unknown quantity at this point 
Solved Threads: 0
Big Riv Big Riv is offline Offline
Newbie Poster

Password Protection from a txt.file

 
0
  #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?
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 210
Reputation: suRoot is an unknown quantity at this point 
Solved Threads: 8
suRoot's Avatar
suRoot suRoot is offline Offline
Posting Whiz in Training

Re: Password Protection from a txt.file

 
0
  #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 Quick reply to this message  
Join Date: Jan 2005
Posts: 2
Reputation: Big Riv is an unknown quantity at this point 
Solved Threads: 0
Big Riv Big Riv is offline Offline
Newbie Poster

Re: Password Protection from a txt.file

 
0
  #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 Quick reply to this message  
Join Date: Jun 2005
Posts: 354
Reputation: Troy is an unknown quantity at this point 
Solved Threads: 5
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: Password Protection from a txt.file

 
0
  #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 Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Password Protection from a txt.file

 
0
  #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 Quick reply to this message  
Join Date: Jun 2005
Posts: 354
Reputation: Troy is an unknown quantity at this point 
Solved Threads: 5
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: Password Protection from a txt.file

 
0
  #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 Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC