[PHP-DOC] cvs: phpdoc /it/functions http.xml From: Luca Perugini (l.perugini <email protected>)
Date: 08/31/00

perugini Thu Aug 31 09:37:15 2000 EDT

  Modified files:
    /phpdoc/it/functions http.xml
  Log:
  Sync with en tree.
  
  
Index: phpdoc/it/functions/http.xml
diff -u phpdoc/it/functions/http.xml:1.4 phpdoc/it/functions/http.xml:1.5
--- phpdoc/it/functions/http.xml:1.4 Sat Jul 1 10:21:10 2000
+++ phpdoc/it/functions/http.xml Thu Aug 31 09:37:14 2000
@@ -79,9 +79,35 @@
       </programlisting>
      </informalexample>
     </para>
+ <para>
+ See also <function>headers_sent</function>
+ </para>
    </refsect1>
   </refentry>
 
+ <refentry id="function.headers-sent">
+ <refnamediv>
+ <refname>header_sent</refname>
+ <refpurpose>Returns true if headers have been sent</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>boolean <function>headers_sent</function></funcdef>
+ <paramdef><parameter>void</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function returns true if the HTTP headers have already been
+ sent, false otherwise.
+ </para>
+ <para>
+ See also <function>header</function>
+ </para>
+ </refsect1>
+ </refentry>
+
   <refentry id="function.setcookie">
    <refnamediv>
     <refname>setcookie</refname>
@@ -93,15 +119,25 @@
      <funcprototype>
       <funcdef>int <function>setcookie</function></funcdef>
       <paramdef>string <parameter>name</parameter></paramdef>
- <paramdef>string <parameter>value</parameter></paramdef>
- <paramdef>int <parameter>expire</parameter></paramdef>
- <paramdef>string <parameter>path</parameter></paramdef>
- <paramdef>string <parameter>domain</parameter></paramdef>
- <paramdef>int <parameter>secure</parameter></paramdef>
+ <paramdef>string
+ <parameter><optional>value</optional></parameter>
+ </paramdef>
+ <paramdef>int
+ <parameter><optional>expire</optional></parameter>
+ </paramdef>
+ <paramdef>string
+ <parameter><optional>path</optional></parameter>
+ </paramdef>
+ <paramdef>string
+ <parameter><optional>domain</optional></parameter>
+ </paramdef>
+ <paramdef>int
+ <parameter><optional>secure</optional></parameter>
+ </paramdef>
      </funcprototype>
     </funcsynopsis>
     <para>
- <function>setcookie</function> defines a cookie to be sent along
+ <function>Setcookie</function> defines a cookie to be sent along
      with the rest of the header information. Cookies must be sent
      <emphasis>before</emphasis> any other headers are sent (this is a
      restriction of cookies, not PHP). This requires you to place
@@ -124,27 +160,48 @@
      <parameter>secure</parameter> indicates that the cookie should
      only be transmitted over a secure HTTPS connection.
     </para>
- <para>
+ <para>
      Common Pitfalls:
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ Cookies will not become visible until the next loading of a page that
+ the cookie should be visible for.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Cookies must be deleted with the same parameters as they were set with.
+ </simpara>
+ </listitem>
+ </itemizedlist>
     </para>
     <simpara>
- Cookies will not become visible until the next loading of a page that
- the cookie should be visible for.
- </simpara>
- <simpara>
- Multiple calls to <function>setcookie</function> in the same
+ In PHP3, multiple calls to <function>setcookie</function> in the same
      script will be performed in reverse order. If you are trying to
      delete one cookie before inserting another you should put the
- insert before the delete.
+ insert before the delete. In PHP4, multiple calls to
+ <function>setcookie</function> are performed in the order called.
     </simpara>
     <para>
- Some examples follow:
+ Some examples follow how to send cookies:
      <example>
- <title><function>setcookie</function> examples</title>
+ <title><function>Setcookie</function> send examples</title>
       <programlisting role="php">
 setcookie ("TestCookie", "Test Value");
 setcookie ("TestCookie", $value,time()+3600); /* expire in 1 hour */
 setcookie ("TestCookie", $value,time()+3600, "/~rasmus/", ".utoronto.ca", 1);
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ Examples follow how to delete cookies send in previous example:
+ <example>
+ <title><function>setcookie</function> delete examples</title>
+ <programlisting role="php">
+setcookie ("TestCookie");
+setcookie ("TestCookie", "", time());
+setcookie ("TestCookie", "", time(), "/~rasmus/", ".utoronto.ca", 1);
       </programlisting>
      </example>
     </para>