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

search for in the

header> <gmp_xor
Last updated: Sat, 17 Jul 2004
view this page in

XXXVIII. HTTP 함수

소개

이 함수들은 HTTP 프로토콜 단계에서 원격 브라우저로 출력을 다루게 합니다.

요구 사항

이 확장 모듈을 빌드할 때 외부 라이브러리가 필요하지 않습니다.

설치

이 함수들은 설치하지 않아도 사용할 수 있습니다; PHP 코어의 일부입니다.

런타임 설정

이 확장 모듈은 php.ini 설정이 존재하지 않습니다.

리소스 종류

이 확장 모듈은 리소스형을 정의하지 않습니다.

상수 정의

이 확장 모듈은 상수를 정의하지 않습니다.

차례
header -- raw HTTP 헤더를 전송합니다.
headers_list -- 전송한 (혹은 대기중의) 응답 헤더 목록을 반환합니다.
headers_sent -- 헤더 전송 여부를 확인합니다.
setcookie -- 쿠키를 전송합니다.
setrawcookie -- Send a cookie without urlencoding the cookie value


add a note add a note User Contributed Notes
HTTP 함수
alan at akbkhome dot com
11-Aug-2006 01:49
Note: the Classes are Only available in PHP5, the functions however work in both PHP4 and PHP5.
henke dot andersson at comhem dot se
15-Jan-2006 07:31
If you want to make outgoing http connections with php, concider the curl extension.
woei at xs4all dot nl
01-Dec-2005 02:27
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
08-Jul-2004 04:09
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.
28-Apr-2004 11:35
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 08:25
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
05-Jan-2001 03:07
$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.)

header> <gmp_xor
Last updated: Sat, 17 Jul 2004
 
 
show source | credits | sitemap | contact | advertising | mirror sites