Re: [PHP] Sessions vs passing variables

2002-07-21 Thread Mike Mannakee

Right, I understand I should be able to access them.  That's the whole
problem.  They're not there.

I can do one of two things and they magically become available:

1. Don't start the session.

2. Use single variables, not arrays.

#2, however, would create a problem in that I intend to set it up that a
person can have more than one item in their shopping cart.  This hoses that,
as I was planning on having the product ids passed as hidden fields so as
not to have to rely on the session functions to keep items in the shopping
cart.

Mike


"John Holmes" <[EMAIL PROTECTED]> wrote in message
002001c23131$e05a0670$b402a8c0@mango">news:002001c23131$e05a0670$b402a8c0@mango...
> > 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.
>
> > > > Order
>
> 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...
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Sessions vs passing variables

2002-07-21 Thread John Holmes

> 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.

> > > Order

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...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Sessions vs passing variables

2002-07-21 Thread Mike Mannakee

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.

Mike


"John Holmes" <[EMAIL PROTECTED]> wrote in message
001e01c2312e$a6149aa0$b402a8c0@mango">news:001e01c2312e$a6149aa0$b402a8c0@mango...
> How are you testing whether the variables were passed or not? What
> version of PHP are you using and is register_globals ON or OFF?
>
> ---John Holmes...
>
> > -Original Message-
> > From: Mike Mannakee [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, July 21, 2002 10:57 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Sessions vs passing variables
> >
> > No,
> >
> > The strange thing is there isn't.  I have a test page that links to
> the
> > order form, having this html:
> >
> > 
> > 
> > 
> > 
> > 
> > 
> >
> >
> > 
> > Order
> >
> > I've tried it here as both a link and as hidden forms.  Neither on
> works
> > if
> > I begin the script with:
> >
> > if(!(session_id()))
> >  session_start();
> >
> > I've actually figured a bit of a workaround by having the session
> begun on
> > earlier pages, and just continued on the order form.  I think when a
> > session
> > is begun the server sends a cookie to the browser, and somehow that
> > transaction wipes out the variables, whether posted or passed by URL.
> > It's
> > a bit of a pain but it seems to be working.  I'm just now slightly
> nervous
> > that the order form is unable to begin a session if it needs to, but
> one
> > lives, right?
> >
> > Mike
> >
> >
> > "John Holmes" <[EMAIL PROTECTED]> wrote in message
> > 001b01c2311f$e19a2cc0$b402a8c0@mango">news:001b01c2311f$e19a2cc0$b402a8c0@mango...
> > > > When I try to pass a variable from one page to another the
> variable is
> > > > completely inaccessible IF I have a session going.  The data has
> to be
> > > > passed from one page to the next through the link, as the link
> tells
> > > which
> > > > product the user hit.  Any thoughts?
> > >
> > > Is there a variable by the same name in the session? If
> register_globals
> > > is on, the session value could be overwriting the GET value.
> > >
> > > ---John Holmes...
> > >
> >
> >
> >
> > --
> > 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




RE: [PHP] Sessions vs passing variables

2002-07-21 Thread John Holmes

How are you testing whether the variables were passed or not? What
version of PHP are you using and is register_globals ON or OFF?

---John Holmes...

> -Original Message-
> From: Mike Mannakee [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 21, 2002 10:57 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Sessions vs passing variables
> 
> No,
> 
> The strange thing is there isn't.  I have a test page that links to
the
> order form, having this html:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Order
> 
> I've tried it here as both a link and as hidden forms.  Neither on
works
> if
> I begin the script with:
> 
> if(!(session_id()))
>  session_start();
> 
> I've actually figured a bit of a workaround by having the session
begun on
> earlier pages, and just continued on the order form.  I think when a
> session
> is begun the server sends a cookie to the browser, and somehow that
> transaction wipes out the variables, whether posted or passed by URL.
> It's
> a bit of a pain but it seems to be working.  I'm just now slightly
nervous
> that the order form is unable to begin a session if it needs to, but
one
> lives, right?
> 
> Mike
> 
> 
> "John Holmes" <[EMAIL PROTECTED]> wrote in message
> 001b01c2311f$e19a2cc0$b402a8c0@mango">news:001b01c2311f$e19a2cc0$b402a8c0@mango...
> > > When I try to pass a variable from one page to another the
variable is
> > > completely inaccessible IF I have a session going.  The data has
to be
> > > passed from one page to the next through the link, as the link
tells
> > which
> > > product the user hit.  Any thoughts?
> >
> > Is there a variable by the same name in the session? If
register_globals
> > is on, the session value could be overwriting the GET value.
> >
> > ---John Holmes...
> >
> 
> 
> 
> --
> 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




Re: [PHP] Sessions vs passing variables

2002-07-21 Thread Mike Mannakee

No,

The strange thing is there isn't.  I have a test page that links to the
order form, having this html:










Order

I've tried it here as both a link and as hidden forms.  Neither on works if
I begin the script with:

if(!(session_id()))
 session_start();

I've actually figured a bit of a workaround by having the session begun on
earlier pages, and just continued on the order form.  I think when a session
is begun the server sends a cookie to the browser, and somehow that
transaction wipes out the variables, whether posted or passed by URL.  It's
a bit of a pain but it seems to be working.  I'm just now slightly nervous
that the order form is unable to begin a session if it needs to, but one
lives, right?

Mike


"John Holmes" <[EMAIL PROTECTED]> wrote in message
001b01c2311f$e19a2cc0$b402a8c0@mango">news:001b01c2311f$e19a2cc0$b402a8c0@mango...
> > When I try to pass a variable from one page to another the variable is
> > completely inaccessible IF I have a session going.  The data has to be
> > passed from one page to the next through the link, as the link tells
> which
> > product the user hit.  Any thoughts?
>
> Is there a variable by the same name in the session? If register_globals
> is on, the session value could be overwriting the GET value.
>
> ---John Holmes...
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Sessions vs passing variables

2002-07-21 Thread John Holmes

> When I try to pass a variable from one page to another the variable is
> completely inaccessible IF I have a session going.  The data has to be
> passed from one page to the next through the link, as the link tells
which
> product the user hit.  Any thoughts?

Is there a variable by the same name in the session? If register_globals
is on, the session value could be overwriting the GET value.

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Sessions vs passing variables

2002-07-21 Thread Mike Mannakee

When I try to pass a variable from one page to another the variable is
completely inaccessible IF I have a session going.  The data has to be
passed from one page to the next through the link, as the link tells which
product the user hit.  Any thoughts?

Mike Mannakee



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php