RE: [PHP-WIN] track_vars and register_globals
| From: | Shrock, Court | Date: | Mon, 08 Jul 2002 20:20:48 +0000 |
| Subject: | RE: [PHP-WIN] track_vars and register_globals | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-14609@lists.php.net to get a copy of this message | ||
$SESSION['count'] wouldn't work....but $_SESSION['count'] should....if not,
you are using an older version of PHP.
> -----Original Message-----
> From: David Elliott [mailto:list@elliott.uk.com]
> Sent: Monday, July 08, 2002 1:18 PM
> To: php-windows
> Subject: Re: [PHP-WIN] track_vars and register_globals
>
>
> Hi Scott
>
> On 08 July 2002 at 10:02:42 -0500 (which was 16:02 where I
> live) Scott Carr wrote
>
> > $SESSION['count'] should be used to access the variable.
>
> Did not work but see below.
>
> > Register globals set to true, would let you use $count, but is not
> > suggested due to security risks.
>
> True that is why I have it turned off.
>
> This worked, thanks Scot for the pointer.
> ==========8<==================================================
> ===========
> <?
> session_start();
> if (!session_is_registered('count'))
> {
> session_register('count');
> $count = 1;
> }
> else
> {
> $count = $HTTP_SESSION_VARS["count"] +1;
> $HTTP_SESSION_VARS["count"] = $count ;
> }
> ?>
> Hello visitor, you have seen this page <?= $count; ?>
> times.<p> <?= session_id(); ?><br> To continue, <A
> HREF="page2.php">click here</A>
> ==========8<==================================================
> ===========
> --
> BFN,
> _______________________________________________
> David | David Elliott | Software
> Engineer |
> _________________________| list@elliott.uk.com | PGP Key ID
> 0x650F4534 |
> | Ah Sarcasm, Gotta love it. -- Garrison Jim of Bajor.
> |
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>