RE: [PHP] count link clicks
| From: | Rasmus Lerdorf | Date: | Tue, 13 Aug 2002 19:18:36 +0000 |
| Subject: | RE: [PHP] count link clicks | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112414@lists.php.net to get a copy of this message | ||
Then you are going to have to lock a text file, but chances are you will
end up deadlocking things. I'd rethink the whole thing if I were you.
-Rasmus
On Tue, 13 Aug 2002, vic wrote:
> I have no database, this has to be done in PHP
>
> - Vic
>
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus@php.net]
> Sent: Tuesday, August 13, 2002 3:05 PM
> To: vic
> Cc: victor@argilent.com; php-general@lists.php.net
> Subject: RE: [PHP] count link clicks
>
> > Really? That sounds more complicated than I think I need it to be,
> can't
> > I use something like:
> >
> > '<a
> > href="'.$PHP_SELF.'?add_form='.$value.'">'
> >
> > and somehow (this is what I need to know) get $value to increase in
> > value as the user clicks on the link again and again...
>
> Nope, you would be fighting race conditions forever with an approach
> like
> that. You need an atomic way to increment a counter. The best way to
> do
> that is to use the builtin atomicity of a database engine.
>
> -Rasmus
>
> ______________________________________________________________________
> Post your ad for free now! http://personals.yahoo.ca
>