RE: [PHP] Register Globals Query
| From: | caspar kennerdale | Date: | Wed, 30 Apr 2003 11:09:13 +0000 |
| Subject: | RE: [PHP] Register Globals Query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145757@lists.php.net to get a copy of this message | ||
cheers
this makes sense.
the dilemma really is, how far to go down this path,
whilst is is the more secure to have register globals turned off and forces
a stricter programming style, very few isp's have turned it off themselves
(or havent upgraded). if mainitaining your own server fine, but when
maintaining on behalf of clients then the ball is in the isp court!
-----Original Message-----
From: Mike [mailto:php-digest@custom87.net]
Sent: 29 April 2003 22:07
To: caspar kennerdale
Subject: RE: [PHP] Register Globals Query
Or even better, there are functions so you can do a
foreach ($_GET as $key => $value) {
$test = $key . "=" . $value;
parse_str($test);
}
and then you'd have all your get vars as normal variables...
-Michael
On Tue, 2003-04-29 at 12:59, caspar kennerdale wrote:
> perfect
> thank you very much
> why is it that the simplest things are the hardest to get!
>
> -----Original Message-----
> From: Mark [mailto:mark_weinstock@yahoo.com]
> Sent: 29 April 2003 18:06
> To: php-general@lists.php.net
> Subject: RE: [PHP] Register Globals Query
>
>
> Just put
>
> $variable=$_GET["variable"];
>
> somewhere before you want to use it, then use $variable as you
> normally would.
>
> --- caspar kennerdale <caspar@thetuckshop.com> wrote:
> > "That is the appropriate method - you would use $_GET{"variable"].
> > I'm
> > having trouble searching php.net right now, but is it possible that
> > "variable" is reserved?"
> >
> >
> > My problem here is that as I want to have
> >
> > admin.php?action=Test&variable=123 as a link.
> >
> > 'action' is my switch and is requested as $_GET("action") at the
> > top of the
> > switch, but I am unsure as where to place place the
> > $GET("variable") to make
> > the following code work.
> >
> > switch ($_GET['action']) {
> > default:
> > echo "<a
> > href=\"admin.php?action=Test&variable=yes\">test</a>";
> >
> > break;
> >
> > case "Test":
> > echo $variable;
> > break;
> >
> > }
> >
> > Thanks
> >
> >
> >
> > =====
> > Mark Weinstock
> > mark_weinstock@yahoo.com
> > ***************************************
> > You can't demand something as a "right" unless you are willing to
> > fight to
> > death to defend everyone else's right to the same thing.
> > ***************************************
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo.
> > http://search.yahoo.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> =====
> Mark Weinstock
> mark_weinstock@yahoo.com
> ***************************************
> You can't demand something as a "right" unless you are willing to fight to
> death to defend everyone else's right to the same thing.
> ***************************************
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>