For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > December 2005 > cvs: phpdoc /en/reference/http/functions header.xml









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: phpdoc /en/reference/http/functions header.xml
Curt Zirzow

2005-12-09, 4:02 am

curt Fri Dec 9 00:39:19 2005 EDT

Modified files:
/phpdoc/en/reference/http/functions header.xml
Log:
Syntax error in example, and make the example a bit clearer.


http://cvs.php.net/diff.php/phpdoc/...27&r2=1.28&ty=u
Index: phpdoc/en/reference/http/functions/header.xml
diff -u phpdoc/en/reference/http/functions/header.xml:1.27 phpdoc/en/reference/http/functions/header.xml:1.28
--- phpdoc/en/reference/http/functions/header.xml:1.27 Tue Sep 6 11:03:44 2005
+++ phpdoc/en/reference/http/functions/header.xml Fri Dec 9 00:39:15 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.27 $ -->
+<!-- $Revision: 1.28 $ -->
<!-- splitted from ./en/functions/http.xml, last change in rev 1.2 -->
<refentry id="function.header">
<refnamediv>
@@ -106,9 +106,12 @@
<programlisting role="php">
<![CDATA[
<?php
-header("Location: http://" . $_SERVER['HTTP_HOST']
- . rtrim(dirname($_SERVER['PHP_SELF']), '/\')
- . "/" . $relative_url);
+/* Redirect to a different page in the current directory that was requested */
+$host = $_SERVER['HTTP_HOST'];
+$uri = rtrim(dirname($_SERVER['PHP_SELF']);
+$extra = 'mypage.php';
+header("Location: http://$host$uri/$extra");
+exit;
?>
]]>
</programlisting>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com