I guess you're not the person who emailed me a couple of days ago. But if
you know the answer some time in the future, I still would like to know why
I still need to use session_register() although the manual specified I don't
need it if I use $_session["var"].


----- Original Message -----
From: "Asendorf, John" <[EMAIL PROTECTED]>
To: "B.T." <[EMAIL PROTECTED]>
Sent: Thursday, April 04, 2002 11:37 AM
Subject: RE: [PHP-WIN] For John w/ Q about $_SESSION


> I haven't had any trouble with it, but I was interested and gave it a
try...
>
> The line:
>
> if (!isset($_SESSION["foo"])) {
>
> should hit if the session variable IS NOT set, but it echoes "foo is
> registered..."
>
> I don't quite get why that is true...
>
> ---------------------
> John Asendorf - [EMAIL PROTECTED]
> Web Applications Developer
> http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> Licking County, Ohio, USA
> 740-349-3631
> Nullum magnum ingenium sine mixtura dementiae fuit
>
>
> > -----Original Message-----
> > From: B.T. [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 04, 2002 2:34 PM
> > To: Asendorf, John
> > Subject: Re: [PHP-WIN] For John w/ Q about $_SESSION
> >
> >
> > Sorry didn't pay attention on the last name but was it you
> > that had the same
> > problem with me as to maintain session variables across pages?
> >
> > ----- Original Message -----
> > From: "Asendorf, John" <[EMAIL PROTECTED]>
> > To: "B.T." <[EMAIL PROTECTED]>
> > Sent: Thursday, April 04, 2002 10:52 AM
> > Subject: RE: [PHP-WIN] For John w/ Q about $_SESSION
> >
> >
> > > Me John? Or some other John?
> > >
> > > ---------------------
> > > John Asendorf - [EMAIL PROTECTED]
> > > Web Applications Developer
> > > http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> > > Licking County, Ohio, USA
> > > 740-349-3631
> > > Nullum magnum ingenium sine mixtura dementiae fuit
> > >
> > >
> > > > -----Original Message-----
> > > > From: B.T. [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, April 04, 2002 1:28 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP-WIN] For John w/ Q about $_SESSION
> > > >
> > > >
> > > > Sorry to use public forum I totally lost your email address,
> > > > but anyways, I finally managed to make this $_SESSION work
> > > > although it's still weird to me (newbie) because the manual
> > > > still said session_register() is not needed, but I couldn't
> > > > find any other way to do it. Enough said, here's my test file
> > > > (as is), just take a look at it and see if you can run it on
> > > > your machine:
> > > >
> > > >
> > > > ---- File 1 ----
> > > > <?
> > > > session_start();
> > > > //if (!isset($_SESSION['foo'])) {
> > > > //$_SESSION['foo'] = "test foo";
> > > > session_register("foo");
> > > > $foo = "Another test";
> > > > //}
> > > >
> > > > session_register("groo");
> > > > $groo = "Test 2";
> > > >
> > > > ?><html><head><title>Reg Ses</title></head>
> > > > <body bgcolor="#FFFFFF">
> > > > <? // echo $_SESSION['foo'] . "<br>";
> > > > echo session_id() . "<br>";
> > > > echo $groo . "<br>";
> > > >
> > > > echo "<br><br>";
> > > > ?>
> > > > <a href="reg_2.php">reg_2.php</a>
> > > > </body>
> > > > </html>
> > > >
> > > > ---- File 2 ----
> > > > <?
> > > > session_start();
> > > > ?><html><head><title>Sess</title>
> > > >     </head>
> > > > <body bgcolor="#FFFFFF">
> > > > <? print $_SESSION["foo"]." \$_SESSION <br>";
> > > >    print $_SESSION["groo"] ." \$_SESSION<br>";
> > > >
> > > >    print "foo: $foo <br>";
> > > >    print "groo: $groo <br>";
> > > >
> > > >    if (!isset($_SESSION["foo"])) {
> > > >       print "foo is registered!";
> > > >    } else {
> > > >       print "foo is not registered!";
> > > >    }
> > > >
> > > >    echo "<br><br>";
> > > >
> > > >    if (session_is_registered("groo")) {
> > > >       print "groo is registered!";
> > > >    } else {
> > > >       print "groo is not registered!";
> > > >    }
> > > >
> > > > ?>
> > > > </body>
> > > > </html>
> > > >
> > >
> >
>

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

Reply via email to