Re: session handling
| From: | Lars Espelid | Date: | Sat, 16 Nov 2002 17:04:04 +0000 |
| Subject: | Re: session handling | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124728@lists.php.net to get a copy of this message | ||
Session-vars won't work on my pages either.
Tried your suggested code, but get the following errors in my browser:
Page 1:
Warning: open(/tmp\sess_22b746f8ee84cf7aadb8da0b37ce9d2a, O_RDWR) failed: m
(2) in c:\apache group\apache\htdocs\system\kode\test.php on line 2
Page 2:
Warning: open(/tmp\sess_22b746f8ee84cf7aadb8da0b37ce9d2a, O_RDWR) failed: m
(2) in c:\apache group\apache\htdocs\system\kode\ident.php on line 2
I have no other code on my pages.
I'm running Apache 1.3.26, PHP 4.0.5 on WinXPpro.
Configuration problem??
Lars
"Orangehairedboy" <me@orangehairedboy.com> skrev i melding
news:20021116072306.39871.qmail@pb1.pair.com...
> Here's what you need:
>
> on page 1.php:
>
> <?php
> session_start();
> $temp = 'someValue';
> session_register("temp");
> ?>
>
> on page 2.php:
>
> <?php
> session_start();
> print $temp; /* PHP sets the variables back the way they were for you! */
> ?>
>
> You have to register the variable with the session first so it knows that
> it's a variable that needs monitored and, when the script finishes, needs
> saved.
>
> Hope this helps!
>
> Lewis
>
> "Anjali Kaur" <kaur_anjali@yahoo.com> wrote in message
> news:20021116023613.17438.qmail@web14308.mail.yahoo.com...
> > i want to access some variables generated in one page
> > in all the other pages, so i thought of using
> > $_SESSION.
> >
> > what i did is :
> >
> > in page1.php i do:
> >
> > $temp = 'someValue';
> > session_start();
> > $_SESSION['abc'] = $temp;
> >
> >
> > in page2.php :
> >
> > session_start();
> > echo($_SESSION['abc']);
> >
> >
> > but i am not able to get the value of abc.
> >
> > please help me out. i went thru the documentation
> > online but cudnt grasp much as to where i am going
> > wrong.
> >
> > thank you.
> > anjali.
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Web Hosting - Let the expert host your site
> > http://webhosting.yahoo.com
>
>