note 31829 deleted from ref.http by victor
| From: | victor@php.net | Date: | Sat, 27 Mar 2004 21:31:32 +0000 |
| Subject: | note 31829 deleted from ref.http by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67262@lists.php.net to get a copy of this message | ||
Note Submitter: nstansbury at redbacksystems dot com
----
I wanted to do an http redirect taking into account their current uri:
ie. authentication failed - redirect to login.php
$NewPage = 'login';
$NewURL = preg_replace( "[\w+(?=\.php)]", $NewPage, $_SERVER[ "SCRIPT_URI" ] );
header( "location: $NewURL\r\n" );
Hope this might be useful for someone.