cvs: peardoc /en/package/http/http redirect.xml

From: Date: Tue, 25 Nov 2003 21:35:28 +0000
Subject: cvs: peardoc /en/package/http/http redirect.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-2011@lists.php.net to get a copy of this message
mj Tue Nov 25 16:35:28 2003 EDT Modified files: /peardoc/en/package/http/http redirect.xml Log: * Adding two examples for HTTP::redirect() Index: peardoc/en/package/http/http/redirect.xml diff -u peardoc/en/package/http/http/redirect.xml:1.2 peardoc/en/package/http/http/redirect.xml:1.3 --- peardoc/en/package/http/http/redirect.xml:1.2 Mon Mar 24 17:28:25 2003 +++ peardoc/en/package/http/http/redirect.xml Tue Nov 25 16:35:28 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.http.http.redirect"> <refnamediv> <refname>HTTP::redirect</refname> @@ -22,6 +22,32 @@ a <literal>Location:</literal> header and exiting. </para> </refsect1> + <refsect1 id="package.http.http.redirect.example"> + &title.example; + <para> + <example> + <title>Redirecting to another site</title> + <programlisting role="php"> +require_once 'HTTP.php'; + +HTTP::redirect("http://example.com/"); + </programlisting> + </example> + </para> + <para> + <example> + <title>Local redirect</title> + <programlisting role="php"> +require_once 'HTTP.php'; + +HTTP::redirect("/foo.php"); + </programlisting> + </example> + This will redirect the client to <filename>/foo.php</filename>. + The method will take care of adding the right hostname as + required by <ulink url="&url.rfc;2616">RFC 2616</ulink>. + </para> + </refsect1> <refsect1 id="package.http.http.redirect.parameter"> &title.param; <para>

« previous php.pear.doc (#2011) next »