goba Sun Dec 1 05:52:42 2002 EDT Modified files: /phpdoc/en/reference/http/functions headers-sent.xml Log: This page incorrectly stated that headers_sent() will return true if the headers were not sent, which is the opposite of how this function behaves. Correcting this. Also made the example work standalone, and reworded the explanation of the new file and line parameters, so it now says that the value is put into those variables and not returned... Index: phpdoc/en/reference/http/functions/headers-sent.xml diff -u phpdoc/en/reference/http/functions/headers-sent.xml:1.10 phpdoc/en/reference/http/functions/headers-sent.xml:1.11 --- phpdoc/en/reference/http/functions/headers-sent.xml:1.10 Thu Nov 7 16:02:39 2002 +++ phpdoc/en/reference/http/functions/headers-sent.xml Sun Dec 1 05:52:42 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <!-- splitted from ./en/functions/http.xml, last change in rev 1.7 --> <refentry id="function.headers-sent"> <refnamediv> @@ -14,16 +14,17 @@ <methodparam choice="opt"><type>int</type><parameter>&line</parameter></methodparam> </methodsynopsis> <simpara> - <function>headers_sent</function> will return &true; if no HTTP headers - have already been sent or &false; otherwise. If the optional + <function>headers_sent</function> will return &false; if no HTTP headers + have already been sent or &true; otherwise. If the optional <parameter>file</parameter> and <parameter>line</parameter> parameters - are set, <function>headers_sent</function> will return the php source - file and line number where output started in the <parameter>file</parameter>. + are set, <function>headers_sent</function> will put the php source + file name and line number where output started in the <parameter>file</parameter> + and <parameter>line</parameter> variables. </simpara> <simpara> You can't add any more header lines using the <function>header</function> function once the header block has already been sent. Using this function - you can at least prevent getting the "Duplicate headers ..." error messages. + you can at least prevent getting HTTP header related error messages. Another option is to use <link linkend="ref.outcontrol">Output Buffering</link>. </simpara> <note> @@ -56,8 +57,9 @@ // You would most likely trigger an error here. } else { - print "Headers already sent in $filename on line $linenum\n"; - print "Cannot redirect, for now please click this $link instead\n"; + print "Headers already sent in $filename on line $linenum\n" . + "Cannot redirect, for now please click this <a " . + "href=\"http://www.example.com\">link</a> instead\n"; exit; }
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php