RE: [PHP] <?=SID?> why does this work
| From: | Keith Vance | Date: | Thu, 06 Jul 2000 15:48:31 +0000 |
| Subject: | RE: [PHP] <?=SID?> why does this work | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5232@lists.php.net to get a copy of this message | ||
That's why I couldn't understand it, I know nothing about ASP.
Thanks,
-----Original Message-----
From: richard@zend.com [mailto:richard@zend.com]
Sent: Wednesday, July 05, 2000 6:21 PM
To: php-general@lists.php.net
Subject: Re: [PHP] <?=SID?> why does this work
In article <70D677608846D41184E20050DA7AA6600ADE5A@144.bzln.com>,
keithv@bzln.com (Keith Vance) wrote:
> Why does a link like this work for adding the PHPSESSID to the URL. <?
> print ( "To continue, <A HREF=\"test_member2.php?" );?><?=SID?><?
> print (
> "\">click here</A>" ); ?>
<?= is short-hand for <?php echo
It's one of the few ideas PHP "stole" from ASP. Mainly because it's one
of the few nice features of ASP. :-)
> I don't get understand this, but I think I should. Also, is it possible to
> make $PHPSESSID global and be able to access it inside a function. I can't
> seem to get that work.
I think SID is a constant, and therefore is inherently global and
available everywhere...
There's really currently no such thing as a global variable from the
perspective of not inside a function: Only inside a function can a
variable be declared global. Constants, however, are global by their
nature.
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net