Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 17th, 2005, 10:21 AM
Jayme Assuncao Casimiro
Guest
 
Posts: n/a
Default 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 |
+---------------------------------------------+
  #2  
Old July 17th, 2005, 10:21 AM
Prabhu
Guest
 
Posts: n/a
Default Re: getting information from http header

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

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

?>

-Prabhu

  #3  
Old July 17th, 2005, 10:21 AM
Prabhu
Guest
 
Posts: n/a
Default Re: getting information from http header

Hi,

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

-Prabhu

  #4  
Old July 17th, 2005, 10:21 AM
Prabhu
Guest
 
Posts: n/a
Default Re: getting information from http header

Hi,


Use the $_GET array...
<?php


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

-Prabhu

  #5  
Old July 17th, 2005, 10:21 AM
Jayme Assuncao Casimiro
Guest
 
Posts: n/a
Default 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 |
+---------------------------------------------+
  #6  
Old July 17th, 2005, 10:21 AM
Prabhu
Guest
 
Posts: n/a
Default Re: getting information from http header

Hi,


Use the $_GET array...
<?php


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

-Prabhu

  #7  
Old July 17th, 2005, 10:22 AM
Justin Koivisto
Guest
 
Posts: n/a
Default 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
  #8  
Old July 17th, 2005, 10:22 AM
Prabhu
Guest
 
Posts: n/a
Default 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

  #9  
Old July 17th, 2005, 10:22 AM
Chung Leong
Guest
 
Posts: n/a
Default 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()
  #10  
Old July 17th, 2005, 10:22 AM
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles