NSAPI_REQUEST_HEADERS(3) 1 NSAPI_REQUEST_HEADERS(3)nsapi_request_headers - Fetch all HTTP request headersSYNOPSIS
array nsapi_request_headers (void )
DESCRIPTION nsapi_request_headers(3) gets all the HTTP headers in the current request. This is only supported when PHP runs as a NSAPI module.
Note
Prior to PHP 4.3.3, getallheaders(3) was only available for the Apache servers. After PHP 4.3.3, getallheaders(3) is an alias for
nsapi_request_headers(3) if you use the NSAPI module.
Note
You can also get at the value of the common CGI variables by reading them from the $_SERVER superglobal, which works whether or not
you are using PHP as a NSAPI module.
RETURN VALUES
Returns an associative array with all the HTTP headers.
EXAMPLES
Example #1
nsapi_request_headers(3) example
<?php
$headers = nsapi_request_headers();
foreach ($headers as $header => $value) {
echo "$header: $value <br />
";
}
?>
PHP Documentation Group NSAPI_REQUEST_HEADERS(3)
Check Out this Related Man Page
APACHE_REQUEST_HEADERS(3) 1 APACHE_REQUEST_HEADERS(3)apache_request_headers - Fetch all HTTP request headersSYNOPSIS
array apache_request_headers (void )
DESCRIPTION
Fetches all HTTP request headers from the current request.
RETURN VALUES
An associative array of all the HTTP headers in the current request, or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.5.7 | |
| | |
| | This function became available in the CLI |
| | server. |
| | |
| 5.4.0 | |
| | |
| | This function became available under FastCGI. |
| | Previously, it was supported when PHP was |
| | installed as an Apache module or by the NSAPI |
| | server module in Netscape/iPlanet/SunONE web- |
| | servers. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
apache_request_headers(3) example
<?php
$headers = apache_request_headers();
foreach ($headers as $header => $value) {
echo "$header: $value <br />
";
}
?>
The above example will output something similar to:
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0
Host: www.example.com
Connection: Keep-Alive
NOTES
Note
You can also get at the value of the common CGI variables by reading them from the environment, which works whether or not you are
using PHP as an Apache module. Use phpinfo(3) to see a list of all of the available environment variables.
SEE ALSO apache_response_headers(3).
PHP Documentation Group APACHE_REQUEST_HEADERS(3)
are they any server variables in bash/SSH scripting as is in PHP or Perl, for example in PHP:
$_SERVER or $_SERVER
I'm trying to retrieve the absolute path of an .SH script I'm running
thank you (6 Replies)
I have done charts in PHP with following environment;
1) PHP 5.2.x
2) Webserver Apache 2.2.4 or higher
3) Perl 5.8.7
4) GD 2.0.1
5) JPgraph 2.1.1
It works fine in Windowx XP, Red hat linux 3.x.Now I need to move this PHP programs to AIX machine which has following environment:
PHP 4.0.6... (6 Replies)
Hello, guys !
I tried to compile PHP on one of my servers (LAMP). Everything worked fine only that I tried to set my march to pentium4 and it did not accepted it. It told me that it is a x86_64 architecture and pentium4 is not supported (I don't remember the exact error, but this was the ideea).... (2 Replies)
Hello.
Could you please suggest the ways, by which one can prevent PHP users from reading other webroots? So far I know two ways: Apache mod_suexec and suphp. But it seems, they both require running PHP as a CGI, right? In this case I will be unable to benefit from APC (php opcache). I am... (4 Replies)
Hi everyone,
I need to update PHP from 5.2.6 to the latest version, and I can't build it properly. I just upgraded Apache to 2.2.17, and that is working fine, but when I build PHP, libphp5.so is not built and placed in the Apache modules folder.
I have stripped the ./configure command down to... (5 Replies)
Hello,
I am trying to compile PHP 5.3.5 on AIX 5.2 with Apache 2.2.17 and Mysql 3.23.58
Apache und Mysql are working fine but if i try to compile PHP i get this error:
with make:
sapi/apache2handler/php_functions.lo main/internal_functions.lo -lmysqlclient -lfreetype -lX11 -lXpm -lpng -lz... (2 Replies)
Hi ,
I have a .txt file in which I have multiple headers, the header record starts with $ symbol...like the first column name is $Account.
I have to keep the header in the first line and delete all the remaining headers which are in the file.
I tried using sort adc.txt | uniq -u , but my... (7 Replies)
I'm not very good at associative arrays; and working on this PHP code has got me a bit stumped. My goal is to populate a (multidimensional) associative array in a PHP while look after a MySQL query. The code fragment looks like this:
while($campaign_row = mysql_fetch_array($campaigninfo))
{
... (9 Replies)
Hi I need to merge 4 files. The issue i am facing is all the files have headers and i do not want them in the final output file. Can anybody suggest how to do it? (5 Replies)
I have a file called "dsout" with empty rows and duplicate headers.
DATE TIME TOTAL_GB USED_GB %USED
--------- -------- ---------- ---------- ----------
03/05/013 12:34 PM 3151.24316 2331.56653 73.988785 ... (3 Replies)
4000 node Botnet derived from PHP superglobal $_SERVER mapped with Google Maps Engine.
https://www.unix.com/members/1-albums112-picture640.png
total ips 54945
unique ips 4000
unique countries 64 (2 Replies)
I am currently trying to do a PHP script that detects automatically if Apache Splunk authentication is required or not but I'm having a hard time since HTTP code 303 is always coming back, even if auth is required or not.
Here is the script so far;
<?php
/**
* Apache Splunk script to... (4 Replies)
On Saturday May 4th the forums will briefly break when I switch our Apache PHP 5.6 module to PHP 7.0.
Previously, I had two sites set up for testing the migration, but for many reasons, the second site has additional issues unrelated to PHP 7.0 so it is hard to debug on a different site and... (3 Replies)