PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Installation> <hash
Last updated: Sun, 25 Nov 2007

view this page in

HTTP

소개

HTTP 확장은 주요 PHP 어플리케이션에 편리하고 강력한 기능을 제공하는 것이 목적입니다.

HTTP의 URL, 날짜, 리다이렉트, 헤더, 메세지를 쉽게 다룰 수 있게 합니다. 즉, 간단하게 임의의 데이터 전송에 캐시 및 재송신 기능을 부가할 수 있고, 클라이언트가 선호하는 언어와 문자셋에 대한 협상을 할 숟도 있습니다.

CURL 지원을 사용한다면, 강력한 요청 기능을 제공합니다. PHP 5 이상에서는 병렬 요청을 할 수 있습니다.

매뉴얼에 있는 추가적인 API 레퍼런스와 설치 및 설정을 하는 방법, 예약된 전역 상수를 다음 섹션에서 확인할 수 있습니다:

클래스

이 확장은 다음의 클래스들을 정의합니다. 이 확장을 PHP에 내장했거나, 실행시에 동적으로 읽어들일 경우에만 사용할 수 있습니다.

HttpResponse 클래스는 PHP v5.1 이상이 필요합니다. 다른 클래스는 PHP v5.0부터 사용할 수 있습니다.

Note: 몇몇 메쏘드는 PHP v5.0에서 사용할 수 없는 점에 주의하십시오.

Table of Contents



Installation> <hash
Last updated: Sun, 25 Nov 2007
 
add a note add a note User Contributed Notes
http
alan at akbkhome dot com
10-Aug-2006 09:19
Note: the Classes are Only available in PHP5, the functions however work in both PHP4 and PHP5.
henke dot andersson at comhem dot se
14-Jan-2006 01:01
If you want to make outgoing http connections with php, concider the curl extension.
woei at xs4all dot nl
30-Nov-2005 07:57
Actually, if you want to redirect a user why let HTML or JavaScript do it? Simply do this:

header("Location: http://www.example.com/");
WeeJames
07-Jul-2004 11:39
Regarding what the guy before said.  We've experienced problems where certain firewalls have encrypted the HTTP_REFERER meaning that it doesnt always contain the place you've come from.

Better to track where the user has come from either in a form post or in the url.
27-Apr-2004 07:05
in reference to toashwinisidhu's and breaker's note, a more effective way would be to use meta-tag redirect, for example.

<?php
$url
= "http://somesite.com/index.php"; // target of the redirect
$delay = "3"; // 3 second delay

echo '<meta http-equiv="refresh" content="'.$delay.';url='.$url.'">';

?>

The meta goes in the head of the HTML.
This method does not require javascript and is supported by most browsers and is rarely, if ever, filterd out.
toashwinisidhu at yahoo dot com
21-Apr-2004 03:55
The method given below may not sometimes work.
The following method has always worked with me:
just put the following 3 lines in your PHP code

?>
<body onload=setTimeout("location.href='$url'",$sec)>
<?PHP
-------?>

$sec is the time in second after which the browser would automatically go to the url. Set it to 0 if you do not want to give any time.
You can use this function on the events of various html/form objects (eg.-onclick for button).eg.
<input type=button value="Go to Php.net" onclick=setTimeout("location.href='php.net'",0)>
Use this to one step back
<input type="button" value="Back" onclick=history.go(-1)>
jeffp-php at outofservice dot com
04-Jan-2001 08:37
$HTTP_RAW_POST_DATA --

You'll usually access variables from forms sent via POST method by just accessing the associated PHP global variable.

However, if your POST data is not URI encoded (i.e., custom application that's not form-based) PHP won't parse the data into nice variables for you.  You will need to use $HTTP_RAW_POST_DATA to access the raw data directly. (This should return a copy of the data given to the PHP process on STDIN; note that you wan't be able to open STDIN and read it yourself because PHP already did so itself.)

Installation> <hash
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites