470,833 Members | 1,224 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

getting information from http header


How do I get the content of a http header named "test" in php?

+---------------------------------------------+
| Jayme Assuncao Casimiro |
| Graduado em Ciência da Computação |
| Estudante de Mestrado em Computação |
| Universidade Federal de Minas Gerais - UFMG |
+---------------------------------------------+
Jul 17 '05 #1
9 1870
Hi,
You can use the $_GET Array...
for eg
<?php

$test = $_GET['test'];
print $test;

?>

-Prabhu

Jul 17 '05 #2
Hi,

Use the $_GET array...
<?php
$test = $_GET['test'];
print test;
?>

-Prabhu

Jul 17 '05 #3
Hi,
Use the $_GET array...
<?php
$test = $_GET['test'];
print test;
?>

-Prabhu

Jul 17 '05 #4

Is it in the same way that a get a parameter from a url?

I know that if I wanna get the value of p1, which is passed as a parameter
in the url I use $_GET['p1'].
Example: http:www.teste.com.br?p1=xx


On Fri, 29 Oct 2004, Prabhu wrote:
Hi,
Use the $_GET array...
<?php
$test = $_GET['test'];
print test;
?>

-Prabhu


+---------------------------------------------+
| Jayme Assuncao Casimiro |
| Graduado em Ciência da Computação |
| Estudante de Mestrado em Computação |
| Universidade Federal de Minas Gerais - UFMG |
+---------------------------------------------+
Jul 17 '05 #5
Hi,
Use the $_GET array...
<?php
$test = $_GET['test'];
print $test;
?>

-Prabhu

Jul 17 '05 #6
Jayme Assuncao Casimiro wrote:
How do I get the content of a http header named "test" in php?


Check under the various $_SERVER['HTTP_*'] entries...

<?php
foreach($_SERVER as $k=>$v)
if(substr($k,0,5)=='HTTP_')
echo "$k : $v<br>";
?>

The actual headers may vary depending on the server's software and os.

--
Justin Koivisto - sp**@koivi.com
http://www.koivi.com
Jul 17 '05 #7
HI,
Sorry I misunderstood ur question...

Try this

<?php

require_once('HTTP/Header.php');
$header = new HTTP_Header('headers');
$test = $header->getHeader();
foreach($test as $key=>$value)
print $key.'=>'.$value.'</BR>';
print $header->getHeader('content-type');
?>

You have to install the HTTP_Header Pear package beforehand...
Hope this helps..

-Prabhu

Jul 17 '05 #8
Jayme Assuncao Casimiro <ja***@dcc.ufmg.br> wrote in message news:<Pine.GSO.4.58.0410291658500.20838@vampira>.. .
How do I get the content of a http header named "test" in php?

+---------------------------------------------+
| Jayme Assuncao Casimiro |
| Graduado em Ci ncia da Computa o |
| Estudante de Mestrado em Computa o |
| Universidade Federal de Minas Gerais - UFMG |
+---------------------------------------------+


See apache_request_headers()
Jul 17 '05 #9
Jayme Assuncao Casimiro <ja***@dcc.ufmg.br> wrote in message news:<Pine.GSO.4.58.0410291658500.20838@vampira>.. .
How do I get the content of a http header named "test" in php?


http://in2.php.net/get_headers

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Daniel Pope | last post: by
3 posts views Thread by C# Learner | last post: by
1 post views Thread by Nuno Magalhaes | last post: by
1 post views Thread by Ben Edwards | last post: by
7 posts views Thread by GaryDean | last post: by
1 post views Thread by Alfonso Acosta | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.