php – How to get included username and password from URLs-ThrowExceptions

Exception or error:

I would like to call my site like this.

In PHP I tried to get user and Password via $_SERVER[“PHP_AUTH_USER”]. But this is not set.
How do I get access to the variable?

Please: I know that there are other possibilities to transport username etc. like’hello’ … My approach is to get a solution by sending it with …@ in front of the domain.
THX in advance for any hint.

var_dump($_SERVER) gives the following:

array(38) {
  string(60) "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  string(8) "12345"
  string(20) "/www/htdocs/12345"
  string(9) "RESPONDER"
  string(27) "dhdhgdh-0rIG@VoNnAAAABA"
  string(0) ""
  string(17) ""
  string(77) "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0"
  string(74) "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
  string(23) "de,en-US;q=0.7,en;q=0.3"
  string(13) "gzip, deflate"
  string(10) "keep-alive"
  string(177) "hys_autoplay=false; _pk_id.2.459d=c9b4d5b7244b15e8.1582627031.1.1582627031.1582627031.; PHPSESSID=69c09a014b52db27b8a23ba739440e97; PIWIK_SESSID=2245baf1d465642b8b63c605cccd2c5c"
  string(1) "1"
  string(0) ""
  string(6) "Apache"
  string(17) ""
  string(12) ""
  string(2) "80"
  string(13) ""
  string(36) "/www/htdocs/12345/hunting/"
  string(4) "http"
  string(0) ""
  string(36) "/www/htdocs/12345/hunting/"
  string(27) ""
  string(53) "/www/htdocs/12345/domain/test/analyser.php"
  string(5) "10412"
  string(7) "CGI/1.1"
  string(8) "HTTP/1.1"
  string(3) "GET"
  string(0) ""
  string(18) "/test/analyser.php"
  string(18) "/test/analyser.php"
  string(18) "/test/analyser.php"
  array(0) {

My htaccess:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *