skpanda 0 Report post Posted February 18, 2005 I want a good Site counter(to keep track of visitors) for my site.....can nebody temme.....where will i get free stuff on this... (dont ask me to google..and try out..i am doing that..just in case u know someplace)ORCan how do i design my own (which seems quite....difficult for me)Plz help!!Satya Share this post Link to post Share on other sites
firedoor 0 Report post Posted February 18, 2005 http://www.bravenet.com/ is a good site, but you have to stick up with the link to the bravenet site on everything you use from them. which completely sucks Share this post Link to post Share on other sites
szupie 0 Report post Posted February 19, 2005 Do you mean tracking them as in including their IPs, visiting time, and stuff? Or do you mean just a counter that increases everytime someone comes? The second one would be very easy. Share this post Link to post Share on other sites
ChronicLoser 0 Report post Posted February 19, 2005 Alright, here is a UNIQUE counter I made that requires php. A unique counter only counts how many DIFFERENT users go to your site. In other words, if you have fifty users who clicked on you site two hundred times, it will only show 50.Alright, first things first. Assuming you have windows, right click on your desktop, and make a new text document. Rename the document to "unique.dat". Alright, make another new text document. Now open up your new text document and paste this into it: <?php$filename = "unique.dat";$file = file($filename);$file = array_unique($file);$hits = count($file);$remote = $_SERVER["REMOTE_ADDR"];$wholefile = file_get_contents($filename); if (preg_match("/$remote/i",$wholefile)) { echo $hits; } else { $fd = fopen ($filename , "a+"); $fout = fwrite ($fd , "$remote\n"); fclose($fd); echo $hits; }?>Done? Alright, now go back to the desktop, and rename this text document "unique.php". Now upload the two files into your hosting account (whether, it's through cpanel or an ftp application). Set your "unique.dat" to CHMOD 777. You're done. Now, wherever you want the number to be displayed on your site, place this in the html of your php file:<?php include("unique.php"); ?>It will only display the number so if you want you can also do something like this to display "unique hits = #"unique hits = <?php include("unique.php"); ?> And that's that. I tried to go through step by step, but if you need additional help feel free to ask Share this post Link to post Share on other sites
redsox58 0 Report post Posted February 19, 2005 Wow I'm going to try that Its very informative. Before that I was using http://statcounter.com/ its free and I think its pretty good.Another Question: How can I use the above code to implement on my blog at blogger.com, if that is at all possible? Share this post Link to post Share on other sites
ChronicLoser 0 Report post Posted February 19, 2005 Wow I'm going to try that Its very informative. Before that I was using http://statcounter.com/ its free and I think its pretty good. Another Question: How can I use the above code to implement on my blog at blogger.com, if that is at all possible? <{POST_SNAPBACK}> if you're refering to my post...then my answer is I don't know it depends on whether or not blogger.com allows php codes. If it does, you're going to have to do the script slightly differently because you will be hosting the "unique.dat" and "unique.php" on a different site, I'm presuming... but if blogger.com does work, simply use: <?php include("http://url-of-your-site/unique.php"); ?>instead Share this post Link to post Share on other sites
hihihihi88 0 Report post Posted February 19, 2005 I want a good Site counter(to keep track of visitors) for my site..... can nebody temme..... where will i get free stuff on this... (dont ask me to google..and try out..i am doing that..just in case u know someplace) OR Can how do i design my own (which seems quite....difficult for me) Plz help!! Satya <{POST_SNAPBACK}> I think it is not hard to find a creative counter , that's mean the layout is beautiful and contain a big function, but in your post you don't mention which counter you want . And also it is easy to design by your own , not difficult if u know cgi or php . From ChronicLoser you have php counter and i am using a cgi counter it is downloaded from japaness website . I don't know japanese but I think it is easy to install if you have learn cgi language . japanese counter : http://www.kent-web.com/ Share this post Link to post Share on other sites
-=Wrighty=- 0 Report post Posted February 19, 2005 Alright, here is a UNIQUE counter I made that requires php. A unique counter only counts how many DIFFERENT users go to your site. In other words, if you have fifty users who clicked on you site two hundred times, it will only show 50. Alright, first things first. Assuming you have windows, right click on your desktop, and make a new text document. Rename the document to "unique.dat". Alright, make another new text document. Now open up your new text document and paste this into it: <?php$filename = "unique.dat";$file = file($filename);$file = array_unique($file);$hits = count($file);$remote = $_SERVER["REMOTE_ADDR"];$wholefile = file_get_contents($filename); if (preg_match("/$remote/i",$wholefile)) { echo $hits; } else { $fd = fopen ($filename , "a+"); $fout = fwrite ($fd , "$remote\n"); fclose($fd); echo $hits; }?>Done? Alright, now go back to the desktop, and rename this text document "unique.php". Now upload the two files into your hosting account (whether, it's through cpanel or an ftp application). Set your "unique.dat" to CHMOD 777. You're done. Now, wherever you want the number to be displayed on your site, place this in the html of your php file: <?php include("unique.php"); ?>It will only display the number so if you want you can also do something like this to display "unique hits = #" unique hits = <?php include("unique.php"); ?> And that's that. I tried to go through step by step, but if you need additional help feel free to ask <{POST_SNAPBACK}> Thats a great code, good work. Share this post Link to post Share on other sites
SingleDaddyof2 0 Report post Posted February 19, 2005 A "UNIQUE" counter...never heard of that one before but I really like that idea. I think I'll try it out on my site. In fact, I think I'll try pairing it up with a regular counter. Thanks for sharing that with us. Share this post Link to post Share on other sites
skpanda 0 Report post Posted February 20, 2005 sorry i was away!!Thanks chronice loser!!i am gonna try it out today!!and certainly..will let u know if i have any queries..Thanks again!! Share this post Link to post Share on other sites
harriko 0 Report post Posted February 20, 2005 this is really good! helps me downloading and trying out all the cgi scripts off the internet. this is really simple! but only works in php, right now i want to learn the damn language but cant get the local machine server working.!i think this should be a in the tutorials section.thanks again! Share this post Link to post Share on other sites
miCRoSCoPiC^eaRthLinG 0 Report post Posted February 22, 2005 This deals mostly with php scripting of counters. So moved to Programming > Scripting---------m^e Share this post Link to post Share on other sites
avalon1405241471 0 Report post Posted February 22, 2005 try not to use text file to store your hits data.it will reset after a certain number of entries.i use to store my hits data in text files, all entries reset to zero or blank after sometime but it stopped when i switch it to store databases. Share this post Link to post Share on other sites
kraizii88z 0 Report post Posted March 9, 2005 Alright, here is a UNIQUE counter I made that requires php. A unique counter only counts how many DIFFERENT users go to your site. In other words, if you have fifty users who clicked on you site two hundred times, it will only show 50. Alright, first things first. Assuming you have windows, right click on your desktop, and make a new text document. Rename the document to "unique.dat". Alright, make another new text document. Now open up your new text document and paste this into it: <?php$filename = "unique.dat";$file = file($filename);$file = array_unique($file);$hits = count($file);$remote = $_SERVER["REMOTE_ADDR"];$wholefile = file_get_contents($filename);  if (preg_match("/$remote/i",$wholefile))  {    echo $hits;  }  else  {    $fd = fopen ($filename , "a+");    $fout = fwrite ($fd , "$remote\n");    fclose($fd);    echo $hits;  }?>Done? Alright, now go back to the desktop, and rename this text document "unique.php". Now upload the two files into your hosting account (whether, it's through cpanel or an ftp application). Set your "unique.dat" to CHMOD 777. You're done. Now, wherever you want the number to be displayed on your site, place this in the html of your php file: <?php include("unique.php"); ?>It will only display the number so if you want you can also do something like this to display "unique hits = #" unique hits = <?php include("unique.php"); ?> And that's that. I tried to go through step by step, but if you need additional help feel free to ask <{POST_SNAPBACK}> Thats a great code, good work. <{POST_SNAPBACK}> That's what i was going to say. Great script... I really appriciate it... i've been using statcounter, though.. good service Share this post Link to post Share on other sites