Connecting Tech Pros Worldwide Forums | Help | Site Map

getting information from http header

Jayme Assuncao Casimiro
Guest
 
Posts: n/a
#1: Jul 17 '05

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 |
+---------------------------------------------+

Prabhu
Guest
 
Posts: n/a
#2: Jul 17 '05

re: getting information from http header


Hi,
You can use the $_GET Array...
for eg
<?php

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

?>

-Prabhu

Prabhu
Guest
 
Posts: n/a
#3: Jul 17 '05

re: getting information from http header


Hi,

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

-Prabhu

Prabhu
Guest
 
Posts: n/a
#4: Jul 17 '05

re: getting information from http header


Hi,


Use the $_GET array...
<?php


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

-Prabhu

Jayme Assuncao Casimiro
Guest
 
Posts: n/a
#5: Jul 17 '05

re: getting information from http header



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:
[color=blue]
> Hi,
>
>
> Use the $_GET array...
> <?php
>
>
> $test = $_GET['test'];
> print test;
> ?>
>
> -Prabhu
>
>[/color]

+---------------------------------------------+
| Jayme Assuncao Casimiro |
| Graduado em Ciência da Computação |
| Estudante de Mestrado em Computação |
| Universidade Federal de Minas Gerais - UFMG |
+---------------------------------------------+
Prabhu
Guest
 
Posts: n/a
#6: Jul 17 '05

re: getting information from http header


Hi,


Use the $_GET array...
<?php


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

-Prabhu

Justin Koivisto
Guest
 
Posts: n/a
#7: Jul 17 '05

re: getting information from http header


Jayme Assuncao Casimiro wrote:
[color=blue]
> How do I get the content of a http header named "test" in php?[/color]

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 - spam@koivi.com
http://www.koivi.com
Prabhu
Guest
 
Posts: n/a
#8: Jul 17 '05

re: getting information from http header


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

Chung Leong
Guest
 
Posts: n/a
#9: Jul 17 '05

re: getting information from http header


Jayme Assuncao Casimiro <jayme@dcc.ufmg.br> wrote in message news:<Pine.GSO.4.58.0410291658500.20838@vampira>.. .[color=blue]
> 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 |
> +---------------------------------------------+[/color]

See apache_request_headers()
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
#10: Jul 17 '05

re: getting information from http header


Jayme Assuncao Casimiro <jayme@dcc.ufmg.br> wrote in message news:<Pine.GSO.4.58.0410291658500.20838@vampira>.. .[color=blue]
> How do I get the content of a http header named "test" in php?[/color]

http://in2.php.net/get_headers

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Closed Thread