login to protected directory by php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



all files (web pages, pictures, and exe files) and folders in a directory
should be protected against anonymous users.
I create an application with php and mysql for registered users. when a user
registers it's information will be saved in database and its username and
password will be added to .htpass file. so registered users can reach
protected area.
But browser prompts login dialog, when users want to access this folder. How
can I run login process with php.
Thanks


On Sat, Aug 14, 2010 at 4:23 PM, chris h <chris404@xxxxxxxxx> wrote:

> it sounds as if apache - or whatever your http server is - is not aware of
> your php script.  All apache knows is that someone is trying to access a
> directory or file that is protected, it does not know that it should send
> that request to the php script for a login.
>
> What are the protected resources that you want a login for?
>
>
> On Sat, Aug 14, 2010 at 1:52 AM, Ali Asghar Toraby Parizy <
> aliasghar.toraby@xxxxxxxxx> wrote:
>
>> Hi
>> The php script is in another folder. I set PHP_AUTH_USER and 'PHP_AUTH_PW
>> in login script then try to open the file in the protected directory. the
>> php file is not in the protected realm.
>>
>>
>> On Sat, Aug 14, 2010 at 3:26 AM, chris h <chris404@xxxxxxxxx> wrote:
>>
>>> Based off what your saying my guess is that the request is not hitting
>>> your php script.
>>>
>>> Is the php script in the protected directory? If so what is it's file
>>> name and what url are you hitting for the test?
>>>
>>>
>>> Chris.
>>>
>>>
>>> On Fri, Aug 13, 2010 at 6:21 PM, Ali Asghar Toraby Parizy <
>>> aliasghar.toraby@xxxxxxxxx> wrote:
>>>
>>>> Hi. I have a protected directory in my host. I have configured .htaccess
>>>> successfully and it works prefect.
>>>> Now I'm looking for a solution to login and logout by a php script.
>>>> In my site I have a login page. In that page I set 'PHP_AUTH_USER' and '
>>>> PHP_AUTH_PW'. but when I try to open protected directory, user
>>>> authentication dialog appears.
>>>> How can I do this? What is my error?
>>>>
>>>> --
>>>> Ali Asghar Torabi
>>>>
>>>
>>>
>>
>>
>> --
>> Ali Asghar Torabi
>>
>
>


-- 
Ali Asghar Torabi



-- 
Ali Asghar Torabi

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux