|
|
Site Counters - Help Needed | ||
Discussion by skpanda with 13 Replies.
Last Update: March 9, 2005, 3:28 pm | |||
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
Fri Feb 18, 2005 Reply New Discussion
Fri Feb 18, 2005 Reply New Discussion
Sat Feb 19, 2005 Reply New Discussion
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:
CODE
<?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:
CODE
<?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 = #"
CODE
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 ^_^
Sat Feb 19, 2005 Reply New Discussion
Another Question: How can I use the above code to implement on my blog at blogger.com, if that is at all possible?
Sat Feb 19, 2005 Reply New Discussion
QUOTE (redsox58)
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?
if you're refering to my post...then my answer is I don't know
but if blogger.com does work, simply use:
CODE
<?php include("http://url-of-your-site/unique.php"); ?>instead
Sat Feb 19, 2005 Reply New Discussion
QUOTE (skpanda)
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
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/
Sat Feb 19, 2005 Reply New Discussion
QUOTE (ChronicLoser)
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:
CODE
<?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:
CODE
<?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 = #"
CODE
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
Thats a great code, good work.
Sat Feb 19, 2005 Reply New Discussion
Sat Feb 19, 2005 Reply New Discussion
Thanks chronice loser!!
i am gonna try it out today!!
and certainly..will let u know if i have any queries..
Thanks again!!
Sun Feb 20, 2005 Reply New Discussion
i think this should be a in the tutorials section.
thanks again!
Sun Feb 20, 2005 Reply New Discussion
m^e
Tue Feb 22, 2005 Reply New Discussion
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.
Tue Feb 22, 2005 Reply New Discussion
QUOTE (ChronicLoser)
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:
CODE
<?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:
CODE
<?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 = #"
CODE
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
Thats a great code, good work.
[/quote]
That's what i was going to say.
Great script... I really appriciate it... i've been using statcounter, though.. good service
Wed Mar 9, 2005 Reply New Discussion
Php: Allow Or Block Browsers (6)
|
(4) PHP Based Site Access Authentication - Help How to block parts of your web-site ??
|
Index




