Sessions

This is a discussion on Sessions within the PHP Language forums, part of the PHP Programming Forums category; I am confused on how to define $_SESSION['text'] On one page I defined: $_SESSION['picture1_type'] = $_FILES['picture1']['type']; echo $...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-19-2004
Ken
 
Posts: n/a
Default 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




Reply With Quote
  #2 (permalink)  
Old 08-19-2004
kingofkolt
 
Posts: n/a
Default Re: Sessions

"Ken" <kkrolski@wi.rr.com> wrote in message
news:T0SUc.48026$ju6.35460@twister.rdc-kc.rr.com...
> 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
>
>
>
>


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


Reply With Quote
  #3 (permalink)  
Old 08-19-2004
Ken
 
Posts: n/a
Default Re: Sessions

Yes, session_start() is called on each page.

There are other session variables that are working.

Ken

"kingofkolt" <jessepNOSPAM@comcast.net> wrote in message
news:mnVUc.43462$TI1.39357@attbi_s52...
> "Ken" <kkrolski@wi.rr.com> wrote in message
> news:T0SUc.48026$ju6.35460@twister.rdc-kc.rr.com...
> > 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
> >
> >
> >
> >

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



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:51 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0