RE: [PHP] <?=SID?> why does this work
| From: | Rasmus Lerdorf | Date: | Thu, 06 Jul 2000 15:56:56 +0000 |
| Subject: | RE: [PHP] <?=SID?> why does this work | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5233@lists.php.net to get a copy of this message | ||
Which is why such silly shortcuts are avoided in most instances in
PHP. Popular demand forced this particular one into PHP though.
-Rasmus
On Thu, 6 Jul 2000, Keith Vance wrote:
> 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.
>