Jump to content

htaccess with php


nick02895

Recommended Posts

I have a site that I use php and mysql to verify users.  It's all working pretty good except the files are accessible via the internet just by knowing the file name.  I was using htaccess and all the users had the same username and password, but now I want everyone to have their own.

 

Question, how do I access the htaccess password directory with php.  I suspect I need to use a session variable, but can't understand how that get's done.

 

Nick

[email protected]

Link to comment
https://forums.phpfreaks.com/topic/115736-htaccess-with-php/
Share on other sites

What I understand there is the htaccess variables can be used in my php scripts.  I've tried reversing that and setting the variables myself in the scripts.

$_SERVER["PHP_AUTH_USER"] = "user";

$_SERVER["PHP_AUTH_PW"] = "pswd" ;

$PHP_AUTH_USER = "user";

$PHP_AUTH_PW = "pswd" ;

 

but I still get the popup box.

 

Can I avoid that box and set the variables myself in my php scripts?

Link to comment
https://forums.phpfreaks.com/topic/115736-htaccess-with-php/#findComment-595110
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.