[pmwiki-users] best practice
Crisses
crisses at kinhost.org
Tue May 9 13:31:25 CDT 2006
On May 9, 2006, at 1:28 PM, Joachim Durchholz wrote:
>> I don't know a lot about it, but from what I do know, these variables
>> can be used for web page counters,
>
> I'd be *very* suprised if that indeed worked. Web page counters
> usually
> store their value somewhere external to PHP, e.g. in a file or in a
> database record.
You have my apologies. The specific example I saw where it was used
as a "page counter" is in the PHP Pocket Reference by O'Reilly (p24
in my copy, but it's not the latest).
However on the PHP.net page, a user comments:
"My first not is probably intuitive to most, but I didn't notice it
mentioned explicitly, so I'll mention it: a static variable does not
retain it's value after the script's execution. Don't count on it
being available from one page request to the next; you'll have to use
a database for that."
Which implies that you are correct. I did say I'd never used it, but
I had made note that using a static variable for a page counter would
be interesting (cf the O'Reilly blunder), and remembered the
reference to Static properly, even if the reference text I got my
information from was incorrect.
Sorry, again.
Crisses
More information about the pmwiki-users
mailing list