[nycphp-talk] accessing $_SESSION elements
Robert Redcay
rob at nyc.yamaha.com
Fri Oct 24 17:57:58 EDT 2003
Aaron,
It seems like what you really want is an array of data. If you have your
form submit the individual fairs as elements of an array ($fairs),
you'll find php's array functions very helpful when determining what
indeces are set. It seems that your prepending an integer to the string
'fair_name' is just a poor man's array which makes your looping tests
akward.
Best,
Robert Redcay
Aaron Fischer wrote:
> Hmm, good reading. However, the second line on the phundamentals
> article says "The focus here will be on determining whether the
> variable contains something;"
>
> Since my form is dynamically generated, the first thing I am trying to
> do is determine if the array element even exists. For example, if the
> user chooses to enter 4 fairs, 5_fair_name will not exist. So, first I
> was checking it's existence using isset, and then if it does I can
> perform operations on it.
>
> Does that sounds like I'm on the right track or are there better ways
> for me to check for the array element's existence?
>
>
> On Friday, October 24, 2003, at 03:22 pm, Michael Southwell wrote:
>
> Aside from all the explicit advice you've gotten about how to
> handle this, make sure that "isset" is actually the test you want.
> Check PHundamentals #2 at _http://phundamentals.nyphp.org_ to see
> (or remember) just how complicated this might be.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>
More information about the talk
mailing list