Re: PHP-.htaccess-CGI



*** psk79 wrote/escribió (28 Apr 2005 11:20:29 -0700):
> I created a set of pages with PHP for login using a database. Now, I
> need to
> link to a lot of CGI programs in a folder with protected-access
> (.htaccess). The
> username and password are the same as the ones people use to login
> with. Is there a way to use the session usrname/password for the HTTP
> authentication to that folder ?? If I remove the .htaccess for that
> particular folder, then all those files will have access without any
> kind of authentication.

I've not really understood what you're trying to accomplish. With Apache
you can password protect CGI files the very same way you protect any other
type of resource: copy your .htaccess file to your cgi-bin folder or any
parent folder.

Maybe you want to write a CGI script that makes use of HTTP authentication.
There must probably be some pre-written libraries out there; the method
itself is not hard to implement, but you need to find and read the RFC
document (you must send an specific HTTP header with auth info). You can
also connect with a browser and sniff the header sent by it. The
LiveHTTPHeaders extension for Mozilla/Firefox makes so very easy.


> I tried username:password@xxxxxxxxxxxxxxx . But this doesnt work with
> IE 6. So I need something else.

All modern browsers allow you to store passwords, you don't need to add it
to bookmarks, if that's what you mean.


--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
.



Relevant Pages

  • Re: Problems with opendir
    ... CGI Is being compiled on fedora core 2. ... > In this case c folder contains only one folder called PCDI ... Looks like an application code bug to me. ...
    (comp.os.linux.development.apps)
  • Re: CGI suddenly dies on RedHat 9 server
    ... now no cgi on the box will run for any remote ... > that the folder should have the ExecCGI option enabled. ... First, login as root, how, when the login page apears that you enter ... acesss rights explained above, WARNING ROBERTSON WARNING WARNING!!!! ...
    (comp.os.linux.questions)
  • Re: How protect non aspx files using Forms Authentication?
    ... >Using Forms Authentication, users can't get to my .aspx pages but they can ... >What setting can I use to protect ALL files within my app from hackers until ... folder and allow only logged on users to access that folder. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Two Authentication
    ... If you dont want to protect certain folder in your application by forms ... > I have a portion of an application that needs to be protected by forms> authentication and another portion that does not. ... The only> problem is that the code-behind forms can't find the project dll. ... If I copy> the dll into a bin folder in the subfolder it works fine. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problems with opendir
    ... CGI Is being compiled on fedora core 2. ... In this case c folder contains only one folder called PCDI ... So it would seam as a bug in opendir function that does not append c/ ...
    (comp.os.linux.development.apps)