hi,
I'm creating a photo gallery. Each user has his own directory. I want to forbide user /vistior to access other directory.He can only view his images under his directory.So, i when i add a user i create directory ('images/username'), .htaccess file under his directory and his login details both in database as well as .htpasswd file. Then i use database login t o allow and disallow view certain functions of the websites.It's worked fine. However, If someone knows user name u can access his images by simply typing url(ie.mysite/imaes/someusername/image2.gif). As I've created .htaccess file its prompt login.

Anway, I've php and mysql login system working. After successing login I want automatically login to www authentication.

This is what i've used


   $_SERVER['PHP_AUTH_USER'] = $name;
   $_SERVER['PHP_AUTH_PW']    = $password;

But it does not login .. it still prompt login in the folder that want to protect.

All i want is once user successfully logged in also login to www login.. things..

    3 months later
    phprock wrote:

    But it does not login .. it still prompt login in the folder that want to protect.

    All i want is once user successfully logged in also login to www login.. things..

    I have a very similar need, and after searching all day, I haven't found a solution.

    Does anyone know if there is a way to have an .htaccess file keep non-php-authenticated users out while having users authenticated within my site not have to login with the .htaccess?

    Thanks for any help!
    -Phrygius

      Write a Reply...