FAQ
Hey,

I've seen Kalle's patch for http://bugs.php.net/bug.php?id=52555.

It actually implements a http_response_code() function to export the
current HTTP response code from SAPI layer to PHP user land.
I'm suggesting to rename that function to get_http_response_code(),
and implement its sister : set_http_response_code().

Something like that should make it :

PHP_FUNCTION(set_http_response_code)
{
long code;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE)
return;

sapi_header_op(SAPI_HEADER_SET_STATUS, &code TSRMLS_CC);

RETURN_TRUE;
}


That would help changing the http response code.
Actually, that can only be done in weird ways, like <?php header(' ',
null, 301); ?>

Julien

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedJun 10, '11 at 12:12p
activeJun 10, '11 at 12:12p
posts1
users1
websitephp.net

1 user in discussion

Julien Pauli: 1 post

People

Translate

site design / logo © 2022 Grokbase