Re: viewing get/post variables

From: Date: Tue, 16 Apr 2002 14:33:09 +0000
Subject: Re: viewing get/post variables
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-93197@lists.php.net to get a copy of this message
You might be thinking of the register_globals parameter here, instead of safe_mode: http://php.he.net/manual/en/configuration.php#ini.register-globals It is, in general best to keep this off so that you can explicitly validate user input. If you trust the POST or GET data, though, you can turn register_globals ON or use the extract() function - http://php.he.net/manual/en/function.extract.php - for example: extract($HTTP_GET_VARS); echo $var1; or in a function, extract($GLOBALS['HTTP_GET_VARS']); echo $var1; I don't think the safe_mode setting affects this, but I'm not sure. Some of the default settings may have changed between 4.0.6 & 4.2; that might explain why behavior changed after upgrading. -steve At 10:43 AM -0300 4/16/02, Martín Marqués wrote:
On Mar 16 Abr 2002 10:35, Christoph Starkmann <kiko@nfq.de> wrote:
Hi Martín!
I can't remmeber how to configure php.ini so that if I get the URL http://localhost/index.php?var1=10 an echo $var1 will return 10 What I mean, is that _GET["var1"] exists, but I want $var1 to be available.
If $var1 is not available directly, your safe_mode seems to be turned on. One way would be to turn safe_mode off again: change the line safe_mode=On to safe_mode=Off
safe_mode is Off.
in your php.ini. The safer way would be to prepare $var1, for example like this: $var1 = $HTTP_GET_VARS["var1"]; Now you can use $var1.
Before I upgraded PHP form 4.0.6 to 4.2.0RC2 it worked directly, without having to pass the $HTTP_GET_VARS. Saludos... :-) -- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? -----------------------------------------------------------------
Martín Marqués                  |        mmarques@unl.edu.ar
Programador, Administrador, DBA |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------
-- +------------------------------------------------------------------------+ | Steve Edberg sbedberg@ucdavis.edu | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | +------------------------------------------------------------------------+ | "If only life would imitate toys." | | - Ted Raimi, March 2002 | | - http://www.whoosh.org/issue67/friends67a.html#raimi | +------------------------------------------------------------------------+

« previous php.general (#93197) next »