RE: [PHP-DB] Access counter
| From: | Walter, Marcel | Date: | Tue, 24 Jul 2001 07:16:27 +0000 |
| Subject: | RE: [PHP-DB] Access counter | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-10699@lists.php.net to get a copy of this message | ||
Another idea of mine:
You could start sessions .... and register a variable...
and everytime a new user wants to request a page you can find
out whether its a new user or not if you check the variable ...
If it is new, then do the stuff below ... elso don´t ...
Cheers,
Marcel
> -----Original Message-----
> From: leo g. divinagracia iii [SMTP:ldivinag@csuhayward.edu]
> Sent: Tuesday, July 24, 2001 06:25
> Cc: PHP-DB
> Subject: Re: [PHP-DB] Access counter
>
> in a simple way, yes.
>
> if you really want unique users, you can setup a table and insert the IP
> addresses in their and query it everytime.
>
> the PHP variable that keeps track of the user'a IP address can also be
> checked by storing it in a variable and re-checked each time the page is
> loaded.
>
> Shahmat Dahlan wrote:
> >
> > If I do the below, like you stated, that means the counter will update
> > everytime a visitor refreshes the content.
> >
> > Would it be possible for the counter script not to increase the value by
> 1
> > when a visitor merely refreshes. Is it possible to let the script
> increase the
> > value by only by one, only if the the visitor for a new content (by
> clearing
> > the cache, e.g.).
> >
> > Thanks you replying..
> >
> > "leo g. divinagracia iii" wrote:
> >
> > > in pseudo-code:
> > >
> > > make a text file - associate it a URL
> > >
> > > when a user comes along, have a PHP script on top of the web page to
> > >
> > > 1. open the text file
> > > 2. counter = counter +1
> > > 3. write update
> > > 3.5 print number of hits somewhere on webpage
> > > 4. close file...
> > >
> > > Shahmat Dahlan wrote:
> > > >
> > > > I'd like to do a counter with PHP, how do you do this? I thought
> maybe I
> > > > could either use cookie or session or session? Which should I use ?
> > > >
>
>
> --
> Leo G. Divinagracia III
> ldivinag@csuhayward.edu
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
If you have received this e-mail in error or wish to read our e-mail disclaimer statement and
monitoring policy, please refer to
http://www.drkw.com/disc/email/ or contact the sender.