CVS update: phpdoc/functions

From: Date: Mon, 28 Jun 1999 02:48:29 +0000
Subject: CVS update: phpdoc/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-7658@lists.php.net to get a copy of this message
Date: Sunday June 27, 1999 @ 22:48 Author: jim Update of /repository/phpdoc/functions In directory php:/tmp/cvs-serv10724/functions Modified Files: http.sgml Log Message: More cleanups. Index: phpdoc/functions/http.sgml diff -u phpdoc/functions/http.sgml:1.3 phpdoc/functions/http.sgml:1.4 --- phpdoc/functions/http.sgml:1.3 Sat Jun 19 23:04:56 1999 +++ phpdoc/functions/http.sgml Sun Jun 27 22:48:28 1999 @@ -1,11 +1,11 @@ <reference id="ref.http"> - <title>functions related to HTTP</title> + <title>Functions related to HTTP</title> <titleabbrev>HTTP</titleabbrev> <partintro> <simpara> - These functions let you manipulate the output sent back to the - remote browser right down to the HTTP protocol level. + These functions let you manipulate the output sent back to the + remote browser right down to the HTTP protocol level. </partintro> <refentry id="function.header"> @@ -33,7 +33,7 @@ <para> <informalexample><programlisting role=php> -Header("Location: http://www.php.net"); /* Redirect browser to PHP web site */ +header("Location: http://www.php.net"); /* Redirect browser to PHP web site */ exit; /* Make sure that code below does not get executed when we redirect. */ </programlisting></informalexample> @@ -68,67 +68,76 @@ <paramdef>int <parameter>secure</parameter></paramdef> </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 + restriction of cookies, not PHP). This requires you to place calls to this function before any <literal>&lt;html></literal> or <literal>&lt;head></literal> tags. - <para> - All the arguments except the <parameter>name</parameter> argument are - optional. If only the name argument is present, the cookie by that name will - be deleted from the remote client. You may also replace any - argument with an empty string (<emphasis>&quot;&quot;</emphasis>) - in order to skip that argument. The - <parameter>expire</parameter> and <parameter>secure</parameter> - arguments are integers and cannot be skipped with an empty - string. Use a zero (<emphasis>0</emphasis>) instead. The - <parameter>expire</parameter> argument is a regular Unix time - integer as returned by the <function>time</function> or - <function>mktime</function> functions. The - <parameter>secure</parameter> indicates that the cookie should - only be transmitted over a secure HTTPS connection. - <para> + + <para> + All the arguments except the <parameter>name</parameter> argument are + optional. If only the name argument is present, the cookie by that + name will be deleted from the remote client. You may also replace + any argument with an empty string (<emphasis>&quot;&quot;</emphasis>) + in order to skip that argument. The <parameter>expire</parameter> + and <parameter>secure</parameter> arguments are integers + and cannot be skipped with an empty string. Use a zero + (<emphasis>0</emphasis>) instead. The <parameter>expire</parameter> + argument is a regular Unix time integer as returned by the + <function>time</function> or <function>mktime</function> functions. + The <parameter>secure</parameter> indicates that the cookie should + only be transmitted over a secure HTTPS connection. + + <para> Common Pitfalls: - <simpara> - Cookies will not become visable until the next loading of a page that + + <simpara> + Cookies will not become visible until the next loading of a page that the cookie should be visable for. - <simpara> - Multiple calls to setcookie in the same script will be performed in the reverse - order. If you are trying to delete one cookie before inserting another you - should put the insert before the delete. - <para> + + <simpara> + Multiple calls to <function>setcookie</function> in the same script + will be performed in the reverse order. If you are trying to delete + one cookie before inserting another you should put the insert before + the delete. + + <para> Some examples follow: <example> - <title>SetCookie examples</title> + <title><function>setcookie</function> 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); +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> Note that the value portion of the cookie will automatically be urlencoded when you send the cookie, and when it is received, it is automatically decoded and assigned to a variable by the same name as the cookie name. To see the contents of our test cookie in a script, simply use one of the following examples: + <informalexample><programlisting role=php> echo $TestCookie; echo $HTTP_COOKIE_VARS["TestCookie"]; </programlisting></informalexample> + <para> For more information on cookies, see Netscape's cookie specification at <ulink url="&spec.cookies;">&spec.cookies;</ulink>. - <simpara> - - <simpara> - Microsoft Internet Explorer 4 with Service Pack 1 applied does - not correctly deal with cookies that have their path parameter - set. - <simpara> - Netscape Communicator 4.05 and Microsoft Internet Explorer 3.x - appear to handle cookies incorrectly when the path and time - are not set. + + <simpara> + Microsoft Internet Explorer 4 with Service Pack 1 applied does + not correctly deal with cookies that have their path parameter + set. + + <simpara> + Netscape Communicator 4.05 and Microsoft Internet Explorer 3.x + appear to handle cookies incorrectly when the path and time + are not set. + </refsect1> </refentry>

« previous php.dev (#7658) next »