in reply to loggin into an Apache htprotected folder via CGI script.
Hm, having played with this before I can tell you that it's not all that easy :( For a successfull login you need three things: a username, a password and a realm. The problem is that neither password nor realm is ever seen by the CGI script. So if you really want to do it yourself you have to use mod_perl. I recommend to have a look at Apache::DBIauth which realises authorisation with (mod_)perl.
Sorry that I can't tell you much more than it's hard and possibly impossible to be done with pure CGI. You can experiment with only one file in your directory having the 'require' option but the entire directory being the realm. If you're lucky apache keeps on authorizing.. But to be honest I can't imagine a scenaio with this kind of setup being positively neccessary.. Think about saving authorized IPs together with a timeout to a file/database or something like that. (This will hardly work for high-traffic sites..)
Hope I was of any help..
Regards,
-octo
|
|---|