Usually, one asks how to do something. Not what functon xxxx does.
Anyway, does http://www.w3schools.com/php/func_http_header.asp answer your question?
Kees
what is Header() function in PHP and For what is this function used in PHP language?
![]() | Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years. Thanks, CNET Support |
what is Header() function in PHP and For what is this function used in PHP language?
Discussion is locked
Usually, one asks how to do something. Not what functon xxxx does.
Anyway, does http://www.w3schools.com/php/func_http_header.asp answer your question?
Kees
it to redirect the user to another page:
http://php.net/manual/en/function.header.php
If you work with PHP, you'll often see the "Warning: Cannot modify header information - headers already sent by" error, which means you already sent output to the screen and can therefore no longer send a header.
~Sovereign
header() is used to send a raw HTTP header.It is important to notice that header() must be called before any actual output is sent..........
syntax:
header(string,replace,http_response_code)
string: Required. Specifies the header string to send.
replace: Optional. Indicates whether the header should replace previous or add a second header. Default is TRUE (will replace). FALSE (allows multiple headers of the same type).
http_response_code: Optional. Forces the HTTP response code to the specified value (available in PHP 4.3 and higher).