NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP Dynamic GET Variables , Do they exist?

CED consult at covenantedesign.com
Fri Apr 30 23:33:02 EDT 2010


Anthony Wlodarski wrote:
> I don't think it is the version of PHP you are using for example from 
> my box:
>
> anthony at anthony-desktop:~$ php -v
> PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: Jan  6 
> 2010 22:41:56)
> Copyright (c) 1997-2009 The PHP Group
> Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
> anthony at anthony-desktop:~$ php -a
> Interactive shell
>
> php > $_GET['abc'] = 'def';
> php > $dynamic_vars['a']['b'] = 'abc';
> php > echo $_GET[$dynamic_vars['a']['b']];
> def
> php > if(isset($_GET[$dynamic_vars['a']['b']])) {
> php { echo $_GET[$dynamic_vars['a']['b']];
> php { }
> def
>
> As you can see I am on 5.2.10-2.
>
> -Anthony
> ------------------------------------------------------------------------
> *From:* CED <consult at covenantedesign.com>
> *To:* NYPHP Talk <talk at lists.nyphp.org>
> *Sent:* Fri, April 30, 2010 8:32:24 PM
> *Subject:* Re: [nycphp-talk] PHP Dynamic GET Variables , Do they exist?
>
> Chris Snyder wrote:
> > On Fri, Apr 30, 2010 at 7:24 PM, CED <consult at covenantedesign.com 
> <mailto:consult at covenantedesign.com>> wrote:
> > 
> >> <?php
> >> //GIVEN a page that is called with:
> >> //    $_GET['abc'] = 'def';
> >> //CODED with:
> >>  $dynamic_vars['a']['b'] = 'abc';
> >>
> >>  // NO WORKY
> >>  echo $_GET[ $dynamic_vars['a']['b'] ] ;
> >>
> >>  // NO WORKY
> >>
> >>  if(isset($_GET[ $dynamic_vars['a']['b'] ])){
> >>      echo $_GET[ $dynamic_vars['a']['b'] ] ;
> >>  }
> >> ?>
> >>
> >> What am I doing wrong?
> >> (this is obviously for demonstration purposes only, the actually 
> variables
> >> have need for being stored in the manner that they are)
> >>
> >> -Ed
> >>   
> >
> > Sample code works for me, php 5.3.2.
> > _______________________________________________
> > New York PHP Users Group Community Talk Mailing List
> > http://lists.nyphp.org/mailman/listinfo/talk
> >
> > http://www.nyphp.org/Show-Participation
> That has got to be it then... 5.2.3 on this box... checking the
> changelog now; Thank you Mr. Snyder. :D
>
> -- 
>
> 995 Maple Hill Road
> Castleton, New York 12033
> 518-331-5061
> Consult at CovenanteDesign.com <mailto:Consult at CovenanteDesign.com>
>
>
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation
I couldn't find anything in the changelog... so that would make sense.

Could you pass the variable in from the url, instead of assigning it 
like an array...and let me know...



-- 
<img src="http://covenantedesign.com/logo.jpg" border ="0">
995 Maple Hill Road
Castleton, New York 12033
518-331-5061
Consult at CovenanteDesign.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20100430/eb49e0d3/attachment.html>


More information about the talk mailing list