Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

nsapi_request_headers(3) [php man page]

NSAPI_REQUEST_HEADERS(3)						 1						  NSAPI_REQUEST_HEADERS(3)

nsapi_request_headers - Fetch all HTTP request headers

SYNOPSIS
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 headers

SYNOPSIS
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)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

server variables in bash scripting

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)
Discussion started by: basher400
6 Replies

2. AIX

PHP,Apache on AIX machine

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)
Discussion started by: kumarangopi
6 Replies

3. UNIX for Dummies Questions & Answers

march for my CPU

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)
Discussion started by: Sergiu-IT
2 Replies

4. UNIX for Dummies Questions & Answers

How to secure PHP in multiuser environment?

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)
Discussion started by: FractalizeR
4 Replies

5. UNIX for Dummies Questions & Answers

insturction for installing Apache and PHP on linux

Hello, Please give me stepwise instruction on installing Apache and PHP on linux. Thanks sheen (6 Replies)
Discussion started by: sheen
6 Replies

6. Linux

how to install PHP ?

how to install PHP which is run as an Apache module or run as CGI on debain .any tips would be appreciated. (3 Replies)
Discussion started by: runeveryday
3 Replies

7. Linux

Cannot successfully build PHP in Fedora 9

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)
Discussion started by: manafi
5 Replies

8. AIX

Compile PHP on AIX 5.2 Error

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)
Discussion started by: dtiger
2 Replies

9. Shell Programming and Scripting

Multiple headers in a file

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)
Discussion started by: gaur.deepti
7 Replies

10. Programming

Populating Associate Arrays in PHP

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)
Discussion started by: Neo
9 Replies

11. Shell Programming and Scripting

Merging File with headers

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)
Discussion started by: Arun Mishra
5 Replies

12. Shell Programming and Scripting

Remove white space and duplicate headers

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)
Discussion started by: Daniel Gate
3 Replies

13. Web Development

Botnet Map from $_SERVER[HTTP_REFERER]

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)
Discussion started by: Neo
2 Replies

14. Shell Programming and Scripting

PHP script that detects if auth is required or not on Apache Splunk

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)
Discussion started by: syrius
4 Replies

15. What is on Your Mind?

Saturday May 4th the Forums Will Briefly Break Testing PHP 5.6 to PHP 7.0

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)
Discussion started by: Neo
3 Replies