RE: [PHP] Sessions vs passing variables
| From: | John Holmes | Date: | Mon, 22 Jul 2002 03:42:59 +0000 |
| Subject: | RE: [PHP] Sessions vs passing variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108805@lists.php.net to get a copy of this message | ||
> I'm on a server with php version 4.2.1 with register globals on. The
main
> test has been can I access the variables in the script? Oddly enough,
if
> I
> didn't use an array they are there for me. Turns out it's only when
I'm
> trying to pass an array. Single variables works fine. I'm beginning
to
> think it's a bug.
Why are you trying to use an array? The values are there, I imagine you
are just trying to access them incorrectly.
> > > <a href=order_form.php?prod_ids[]=9&prod_qtys[]=1>Order</a>
For that URL, which you should be using quotes around, you'll have
$_GET['prod_ids'][0] --> 9 and $_GET['prod_qtys'][0] --> 1. Or,
$prod_ids[0] --> 9, etc, since register_globals is on.
---John Holmes...