TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Want a hitcounter, but not one that can be viewed.

Page: 1 2 Reply
Jan 20th 2005#164878 Report
Member since: Feb 7th 2002
Posts: 1564
mooch, I don't know PHP. But it sound so easy when you describe it like that...Hehe, I would like one of those.
Reply with Quote Reply
Jan 20th 2005#164885 Report
Member since: Dec 17th 2004
Posts: 43
if you'd like, i have a counter script that i wrote for one of my pages.... if you have php/sql access i could show you the code
Reply with Quote Reply
Jan 21st 2005#164912 Report
Member since: Feb 7th 2002
Posts: 1564
I would love to see that code. What do you mean with php access ? The server supports it. But I haven't got PHP or apache (or similar) at home...
Reply with Quote Reply
Jan 21st 2005#164923 Report
Member since: Dec 17th 2004
Posts: 43
make the following query on your mysql database:



CREATE TABLE `counter` (
`id` tinyint(4) NOT NULL auto_increment,
`number` bigint(5) default NULL,
KEY `id` (`id`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
INSERT INTO `counter` VALUES (1, 1);




then, on any page that you want to be counted whenever it is hit, place the following php code whereever you want the current count number to be shown: (where it says 'localhost', 'rootuser', 'pass', and 'selectdatabase' you have to enter your database info there.. you can usualy retrieve that information from your hosting provider.)





$db = mysql_connect("localhost", "rootuser", "pass");
mysql_select_db("selectdatabase",$db);

$result = mysql_query("SELECT * FROM counter",$db);
while ($myrow = mysql_fetch_row($result)) {
printf("%s",($myrow[1]+1));
$sql= mysql_query("UPDATE counter SET number=($myrow[1]+1) WHERE id=1");
}





there are probably easier, more feasible ways to do this through php, but this is just what i have, and works fine.
lemme know if you have any questions
Reply with Quote Reply
Jan 24th 2005#165019 Report
Member since: Feb 7th 2002
Posts: 1564
Thanks , Rollin'. I'll be sure to try it out. Thanks a lot
Reply with Quote Reply
Jan 24th 2005#165047 Report
Member since: Dec 17th 2004
Posts: 43
[QUOTE=Patteman]Thanks , Rollin'. I'll be sure to try it out. Thanks a lot [/QUOTE]also, if you dont want to see the counter on the page... remove this line:


printf("%s",($myrow[1]+1));


you have to make sure to put the rest of the code on any page that you want to be counted tho.
Reply with Quote Reply
Page: 1 2 Back to top
Please login or register above to post in this forum