Sessions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ken

    Sessions

    I am confused on how to define $_SESSION['text']

    On one page I defined:

    $_SESSION['picture1_type'] = $_FILES['picture1']['type'];
    echo $_SESSION['picture1_type'] ;

    echo displayed the correct data. image/gif

    On the next page, I echo:

    echo "Session 1 = ".$_SESSION['picture1_type'];
    $ii=1;
    echo "Session i = ".$_SESSION['picture'.$ii.' _type'];

    Now both display empty value.

    Session 1 = Session i =

    What can make a session variable reset to "" ?

    The other session variables on all pages work correctly; so it is only this
    session variable that is resetting.

    Is it necessary to define a variable on one page and form the session
    variable on the next pager?

    Ken




  • kingofkolt

    #2
    Re: Sessions

    "Ken" <kkrolski@wi.rr .com> wrote in message
    news:T0SUc.4802 6$ju6.35460@twi ster.rdc-kc.rr.com...[color=blue]
    > I am confused on how to define $_SESSION['text']
    >
    > On one page I defined:
    >
    > $_SESSION['picture1_type'] = $_FILES['picture1']['type'];
    > echo $_SESSION['picture1_type'] ;
    >
    > echo displayed the correct data. image/gif
    >
    > On the next page, I echo:
    >
    > echo "Session 1 = ".$_SESSION['picture1_type'];
    > $ii=1;
    > echo "Session i = ".$_SESSION['picture'.$ii.' _type'];
    >
    > Now both display empty value.
    >
    > Session 1 = Session i =
    >
    > What can make a session variable reset to "" ?
    >
    > The other session variables on all pages work correctly; so it is only[/color]
    this[color=blue]
    > session variable that is resetting.
    >
    > Is it necessary to define a variable on one page and form the session
    > variable on the next pager?
    >
    > Ken
    >
    >
    >
    >[/color]

    Did you call session_start() at the beginning of the page?


    Comment

    • Ken

      #3
      Re: Sessions

      Yes, session_start() is called on each page.

      There are other session variables that are working.

      Ken

      "kingofkolt " <jessepNOSPAM@c omcast.net> wrote in message
      news:mnVUc.4346 2$TI1.39357@att bi_s52...[color=blue]
      > "Ken" <kkrolski@wi.rr .com> wrote in message
      > news:T0SUc.4802 6$ju6.35460@twi ster.rdc-kc.rr.com...[color=green]
      > > I am confused on how to define $_SESSION['text']
      > >
      > > On one page I defined:
      > >
      > > $_SESSION['picture1_type'] = $_FILES['picture1']['type'];
      > > echo $_SESSION['picture1_type'] ;
      > >
      > > echo displayed the correct data. image/gif
      > >
      > > On the next page, I echo:
      > >
      > > echo "Session 1 = ".$_SESSION['picture1_type'];
      > > $ii=1;
      > > echo "Session i = ".$_SESSION['picture'.$ii.' _type'];
      > >
      > > Now both display empty value.
      > >
      > > Session 1 = Session i =
      > >
      > > What can make a session variable reset to "" ?
      > >
      > > The other session variables on all pages work correctly; so it is only[/color]
      > this[color=green]
      > > session variable that is resetting.
      > >
      > > Is it necessary to define a variable on one page and form the session
      > > variable on the next pager?
      > >
      > > Ken
      > >
      > >
      > >
      > >[/color]
      >
      > Did you call session_start() at the beginning of the page?
      >
      >[/color]


      Comment

      Working...