RE: [PHP-WIN] Counter in PHP and System Variables

From: Date: Mon, 04 Mar 2002 01:16:19 +0000
Subject: RE: [PHP-WIN] Counter in PHP and System Variables
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-12427@lists.php.net to get a copy of this message
You can use the PHP variable $HTTP_USER_AGENT or you can use javascript's navigator.appName and navigator.appVersion. To create a hit counter, use a database table (named pages?) with a column called hits. Every time the page loads, do: mysql_query("update pages set hits=hits+1 where id='$id'"); $result = mysql_query("select hits from pages where id='$id'"); list($hits) = mysql_fetch_array($result); You could have the $id embedded in your page, or you could set up something more dynamic. Matt Hillebrand -----Original Message----- From: Wayne Hinch [mailto:hinchy2000@lineone.net] Sent: Sunday, March 03, 2002 5:57 AM To: PHP Windows Subject: [PHP-WIN] Counter in PHP and System Variables Hi, I'm currently doing an assignment at university. Is it possible that a hit counter can be created using php if so how can this be done? Lastly how can I show the what browser the client is using in their browser? Cheers Wayne

« previous php.windows (#12427) next »