|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-05 15:02 UTC] mj@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 20 21:00:02 2025 UTC |
Description: ------------ I notice that logging in doesn't bring one back to the page they initially clicked the "Login" link from. I assume that's the intention of the following code: print '<input type="hidden" name="PEAR_OLDURL" value="'; if (basename($_SERVER['PHP_SELF']) == 'login.php') { print '/'; } elseif (isset($_POST['PEAR_OLDURL'])) { print htmlspecialchars($_POST['PEAR_OLDURL']); } else { print htmlspecialchars($_SERVER['REQUEST_URI']); } print "\" />\n"; Quickly glancing at that makes it look like that wouldn't do the trick since PHP_SELF will be login.php in most cases, so "/" will be used and PEAR_OLDURL will never be gotten to. Perhaps this will do the trick? print '<input type="hidden" name="PEAR_OLDURL" value="'; if (isset($_POST['PEAR_OLDURL'])) { print htmlspecialchars($_POST['PEAR_OLDURL']); } elseif (isset($_SERVER['REQUEST_URI']) { print htmlspecialchars($_SERVER['REQUEST_URI']); } else { print '/'; } print "\" />\n"; Thanks.