Introduced in the April 2013 release BMP Sand Box of client code.


$t->header( )

$t->header($string, $replace = true, $http_response_code = null)

Description #

Header() is used to send a raw HTTP header. See the » HTTP/1.1 specification for more information on HTTP headers.

Parameters #

  • $string - A String containing the header string.

  • $replace - Boolean, The optional replace parameter indicates whether the header should replace a previous similar header, or add a second header of the same type. By default it will replace,but if you pass in FALSE as the second argument you can force multiple headers of the same type.

  • $http_response_code - An Integer, or String containing url or page to re-direct to.

  • $header_in_output=false - Forces the HTTP response code to the specified value. Note that this parameter only has an effect if the string is not empty.

Notes #

Currently the setCode() function will automatically replace all header() to $t->header().
From the April 2013 release it is advised to use this mADL function instead.