RE: access to member pages only

by Klaas De Waele <klaas(at)grace.be>

 Date:  Mon, 18 Nov 2002 10:15:20 +0100
 To:  hwg-techniques(at)hwg.org
  todo: View Thread, Original
>> Using PHP

My personal experience with PHP in combination with sessions is a bit less
than that with ASP.  In some way or another, I personally prefer working
with ASP.  You can then set a session variable "login" and "password" and in
every page check against the database.  If it's the same, just do nothing,
but if it's different, forward to the initial login page (and maybe even add
to the database a bad login attempt).

It requires a query in every page however, but considering the power and
memory configuration of serious webservers this shouldn't be an issue at
all.

Alternatives?  Not javascript, and in my personaly opinion cookies either.

One very good, fairly safe and resource friendly alternative is the
.htaccess file which you can use on most any Linux/Unix webserver.  With
this file you can limit access to a directory (path) and if need be
underlying paths to only certain users.  Visitors will be confronted with a
popup box to enter their name and pass.

demo:
http://www.he.net/~jdoe/info/htaccess/example/restricted.html

how-to:
http://faq.clever.net/htaccess.htm

passwordstring generator:
http://www.e2.u-net.com/htaccess/make.htm

htaccess managers:
http://htaccess.technotrade.com/
http://illmatic.net/
http://www.silkphp.com/product_display.php?ProdID=2


Haven't tried those managers myself, but heard some are really good.


- Kayjey -
www.fiatcoupe.net

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.