register_global and header
October 23, 2005 3:31 AM
Subscribe
How would the register_global security upgrade screw up a header re-direct?
I had an old script running on a host that just recently switched register_global from ON to OFF. My PHP skills aren't perfect, but I figured I could just make a list of the variables the script needed and used _GET and _POST to get what I needed.
Everything seems to be working, except for the redirects.
For redirecting, the script uses variations on this:
header("Location: $PHP_SELF");
So I added this:
$PHP_SELF=$_SERVER[PHP_SELF];
When I echo $PHP_SELF, it gives what seems like a reasonable value: "/dir/filename.php "
What have I overlooked?
posted by RobotHero to computers & internet (7 comments total)
posted by handee at 3:37 AM on October 23, 2005