note 25549 modified in language.variables.external by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Fri, 27 Sep 2002 21:12:34 +0000 |
| Subject: | note 25549 modified in language.variables.external by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-37348@lists.php.net to get a copy of this message | ||
[Editor's note: The contributor might have overlooked a simpler way: expand($_GET); (etc.)]
when register_globals is turned off, and u want to use it anyway :)
use this script at the top of your program:
if (is_array($_POST)) {
for (reset($_POST); $key = key($_POST); next($_POST)) {
$$key = $_POST[$key];
}
}
if (is_array($_GET)) {
for (reset($_GET); $key = key($_GET); next($_GET)) {
$$key = $_GET[$key];
}
}
if (is_array($_SESSION)) {
for (reset($_SESSION); $key = key($_SESSION); next($_SESSION)) {
$$key = $_SESSION[$key];
}
}
if (is_array($_COOKIE)) {
for (reset($_COOKIE); $key = key($_COOKIE); next($_COOKIE)) {
$$key = $_COOKIE[$key];
}
}
if (is_array($_PUT)) {
for (reset($_PUT); $key = key($_PUT); next($_PUT)) {
$$key = $_PUT[$key];
}
}
have fun :)
--was--
when register_globals is turned off, and u want to use it anyway :)
use this script at the top of your program:
if (is_array($_POST)) {
for (reset($_POST); $key = key($_POST); next($_POST)) {
$$key = $_POST[$key];
}
}
if (is_array($_GET)) {
for (reset($_GET); $key = key($_GET); next($_GET)) {
$$key = $_GET[$key];
}
}
if (is_array($_SESSION)) {
for (reset($_SESSION); $key = key($_SESSION); next($_SESSION)) {
$$key = $_SESSION[$key];
}
}
if (is_array($_COOKIE)) {
for (reset($_COOKIE); $key = key($_COOKIE); next($_COOKIE)) {
$$key = $_COOKIE[$key];
}
}
if (is_array($_PUT)) {
for (reset($_PUT); $key = key($_PUT); next($_PUT)) {
$$key = $_PUT[$key];
}
}
have fun :)
http://www.php.net/manual/en/language.variables.external.php