Jump to content

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

nick1@nickniquette.com

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.