by Devin Yang
(This article was automatically translated.)

Published - 5 years ago ( Updated - 5 years ago )

Apache removed the Authorization Header, and there is no solution in $_SERVER.

You can try to add the following content in .htaccess, and it will be normal.
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
In this way, you can use pure PHP to get the token in the header of the request.
<?php
echo $_SERVER['HTTP_AUTHORIZATION'];

 

Tags: php

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


php

Randomly generate four yards of English

Randomly generate four yards of English

php

How to install PHP 7.1.7 in the old version of CentOS 5.11?

How to install PHP 7.1.7 on the old version of CentOS 5.11? An insfinit error occurred when compiling by myself. This article introduces my method.

php

Use PHP to clear HiBox's inbox via IMAP

The mailbox for receiving letters has exploded, and I don't want all the letters. Use PHP to clear the inbox. The following is the sample program I copied, with minor adjustments.