summaryrefslogtreecommitdiff
path: root/ext/standard/head.c
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2002-06-21 09:31:21 +0000
committerDerick Rethans <derick@php.net>2002-06-21 09:31:21 +0000
commit6869cb3f5a907500d9553c978fc491748585d9db (patch)
treea40530b71f58a94b359254c223d380c2ffb7f2be /ext/standard/head.c
parent0f4ccfaa27a52b916a78fedae167aaa03808b372 (diff)
downloadphp-git-6869cb3f5a907500d9553c978fc491748585d9db.tar.gz
- Added a new parameter to the header() function which overrides the HTTP
response code. @- Added a new parameter to the header() function which overrides the HTTP @ response code. (Derick)
Diffstat (limited to 'ext/standard/head.c')
-rw-r--r--ext/standard/head.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/standard/head.c b/ext/standard/head.c
index e69905725a..4e4e74c914 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -35,19 +35,20 @@
/* Implementation of the language Header() function */
-/* {{{ proto void header(string header [, bool replace])
+/* {{{ proto void header(string header [, bool replace, [int http_response_code]])
Sends a raw HTTP header */
PHP_FUNCTION(header)
{
char *header;
int header_len;
zend_bool replace = 1;
+ int http_code = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &header,
- &header_len, &replace) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &header,
+ &header_len, &replace, &http_code) == FAILURE) {
return;
}
- sapi_add_header_ex(header, header_len, 1, replace TSRMLS_CC);
+ sapi_add_header_ex(header, header_len, 1, replace, http_code TSRMLS_CC);
}
/* }}} */
@@ -121,7 +122,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
strcat(cookie, "; secure");
}
- return sapi_add_header_ex(cookie, strlen(cookie), 0, 0 TSRMLS_CC);
+ return sapi_add_header_ex(cookie, strlen(cookie), 0, 0, 0 TSRMLS_CC);
}