philip Thu Oct 17 16:33:03 2002 EDT Modified files: /phpdoc/en/reference/http/functions header.xml Log: Expanded pdf content-type example, added <?php ?> to all php code. Index: phpdoc/en/reference/http/functions/header.xml diff -u phpdoc/en/reference/http/functions/header.xml:1.5 phpdoc/en/reference/http/functions/header.xml:1.6 --- phpdoc/en/reference/http/functions/header.xml:1.5 Fri Jun 21 06:02:02 2002 +++ phpdoc/en/reference/http/functions/header.xml Thu Oct 17 16:33:03 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./en/functions/http.xml, last change in rev 1.2 --> <refentry id="function.header"> <refnamediv> @@ -29,8 +29,10 @@ <informalexample> <programlisting role="php"> <![CDATA[ +<?php header('WWW-Authenticate: Negotiate'); header('WWW-Authenticate: NTLM', FALSE); +?> ]]> </programlisting> </informalexample> @@ -74,7 +76,9 @@ <informalexample> <programlisting role="php"> <![CDATA[ +<?php header("Status: 404 Not Found"); +?> ]]> </programlisting> </informalexample> @@ -89,9 +93,11 @@ <informalexample> <programlisting role="php"> <![CDATA[ +<?php header("Location: http://www.example.com/"); /* Redirect browser */ exit; /* Make sure that code below does not get executed when we redirect. */ +?> ]]> </programlisting> </informalexample> @@ -108,9 +114,11 @@ <informalexample> <programlisting> <![CDATA[ +<?php header("Location: http://".$_SERVER['HTTP_HOST'] .dirname($_SERVER['PHP_SELF']) ."/".$relative_url); +?> ]]> </programlisting> </informalexample> @@ -124,12 +132,14 @@ <informalexample> <programlisting role="php"> <![CDATA[ +<?php header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 +?> ]]> </programlisting> </informalexample> @@ -190,10 +200,15 @@ <programlisting role="php"> <![CDATA[ <?php +// We'll be outputting a PDF header("Content-type: application/pdf"); + +// It will be called downloaded.pdf header("Content-Disposition: attachment; filename=downloaded.pdf"); -/* ... output pdf file ... */ +// The PDF source is in original.pdf +readfile('original.pdf'); +?> ]]> </programlisting> </informalexample>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php