unread
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