cvs: pear /HTTP_Header Header.php
| From: | Wolfram Kriesing | Date: | Fri, 07 Feb 2003 10:45:26 +0000 |
| Subject: | cvs: pear /HTTP_Header Header.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-8740@lists.php.net to get a copy of this message | ||
cain Fri Feb 7 05:45:26 2003 EDT
Modified files:
/pear/HTTP_Header Header.php
Log:
- redirect - if no url given, redirect to PHP_SELF
Index: pear/HTTP_Header/Header.php
diff -u pear/HTTP_Header/Header.php:1.5 pear/HTTP_Header/Header.php:1.6
--- pear/HTTP_Header/Header.php:1.5 Tue Jan 28 10:39:19 2003
+++ pear/HTTP_Header/Header.php Fri Feb 7 05:45:26 2003
@@ -15,7 +15,7 @@
// | Authors: Wolfram Kriesing <wk@visionp.de> |
// | |
// +----------------------------------------------------------------------+//
-// $Id: Header.php,v 1.5 2003/01/28 15:39:19 cain Exp $
+// $Id: Header.php,v 1.6 2003/02/07 10:45:26 cain Exp $
require_once 'PEAR.php';
require_once 'HTTP.php';
@@ -202,6 +202,7 @@
* @see HTTP::redirect()
* @author Wolfram Kriesing <wk@visionp.de>
* @param string $url URL where the redirect should go to
+ * if none is given it redirects to the current page
* @param mixed (1) true (default) - only the session-id will be added, this is very useful
* when using trans_sid<br>
* (2) false - no paras to add<br>
@@ -209,8 +210,12 @@
* to be name=>value, otherwise the value is retreived using
* $GLOBALS['paraName']
*/
- function redirect($url,$param=true)
+ function redirect($url=null,$param=true)
{
+ if ($url===null) {
+ $url = $_SERVER['PHP_SELF'];
+ }
+
// true means add the session id only
if ($param === true) {
$param = array( session_name() => session_id() );