Help in trying to make a web page counter
Help in trying to make a web page counter
am 27.08.2007 20:31:49 von tedpottel
Hi
I'm trying to build a counter that will keep trach how many hits I got
and where they came from. In my html pages I have a script of code
that loads in an image. This image is a php file. When this file
executes it adds one to the stack counter,
The problem is that for the referring server, I alawyas get the server
that is hosting the web page that is calling my web page counter. I'm
assuming its because this is the server that calls the php code on my
server.
I have seen other companies do this, how do they do it????
This is what I have so far.
On the client I insert the following code onto my web pages
alt="boston kitchen design" width="267" height="90">
Where
http://216.120.252.101/~multist/ws/add.php is my php script to update
the stat counter
On my stat counter server,
$from=$_SERVER['HTTP_REFERER'];
// $from='ted';
$sql_string="INSERT INTO `tedpott_webstat`.`web_stat` (";
$sql_string=
$sql_string."`customer`,`path_name`,`from_server`,`key_word_ phrase`,`PageID`,`server_name`,`file_name`)";
$sql_string=$sql_string." VALUES (";
$sql_string=$sql_string."'".$customer."','".$path."','".$fro m."','".
$phrase."','".$pg."','".$server."','".$filename."'";
$sql_string=$sql_string.")";
print("
");
print("
");
print("second string b
");
print($sql_string);
print("
");
if (!$results=mysql_query($sql_string,$dblink))
die("could not add new record");
print("updateds database ok");
// close databse connection
mysql_close($dblink);.
Re: Help in trying to make a web page counter
am 27.08.2007 22:27:57 von Michael Fesser
..oO(tedpottel@gmail.com)
>I'm trying to build a counter that will keep trach how many hits I got
>and where they came from.
Your webserver already does this for you. Get the raw server logfiles
and use a logfile analyzer like AWStats. Your host might offer something
like that already.
Micha
Re: Help in trying to make a web page counter
am 28.08.2007 02:30:37 von Jerry Stuckle
tedpottel@gmail.com wrote:
> Hi
> I'm trying to build a counter that will keep trach how many hits I got
> and where they came from. In my html pages I have a script of code
> that loads in an image. This image is a php file. When this file
> executes it adds one to the stack counter,
>
> The problem is that for the referring server, I alawyas get the server
> that is hosting the web page that is calling my web page counter. I'm
> assuming its because this is the server that calls the php code on my
> server.
>
> I have seen other companies do this, how do they do it????
>
> This is what I have so far.
>
> On the client I insert the following code onto my web pages
>
>
> alt="boston kitchen design" width="267" height="90">
>
> Where
> http://216.120.252.101/~multist/ws/add.php is my php script to update
> the stat counter
>
> On my stat counter server,
>
> $from=$_SERVER['HTTP_REFERER'];
> // $from='ted';
> $sql_string="INSERT INTO `tedpott_webstat`.`web_stat` (";
> $sql_string=
> $sql_string."`customer`,`path_name`,`from_server`,`key_word_ phrase`,`PageID`,`server_name`,`file_name`)";
> $sql_string=$sql_string." VALUES (";
> $sql_string=$sql_string."'".$customer."','".$path."','".$fro m."','".
> $phrase."','".$pg."','".$server."','".$filename."'";
> $sql_string=$sql_string.")";
>
> print("
");
> print("
");
> print("second string b
");
> print($sql_string);
> print("
");
> if (!$results=mysql_query($sql_string,$dblink))
> die("could not add new record");
> print("updateds database ok");
>
>
> // close databse connection
> mysql_close($dblink);.
>
What did you expect? It is being loaded because of an img tag in your
code, so that is the referring server. It is not the same as the
referrer (which, BTW, is COMPLETELY UNRELIABLE) for your main page.
No statistics are reliable. You have no idea if your page was cached
somewhere between the client and your server, for instance. But as
Micha indicated, your server log files will give you as good information
as anything.
And BTW - I find those "counters" on a web page to be tacky. Kinda like
a prostitute bragging about how many tricks she turned.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: Help in trying to make a web page counter
am 28.08.2007 02:48:23 von Michael Fesser
..oO(Jerry Stuckle)
>And BTW - I find those "counters" on a web page to be tacky. Kinda like
>a prostitute bragging about how many tricks she turned.
http://www.heise.de/ct/schlagseite/03/22/gross.jpg
SCNR
Micha
Re: Help in trying to make a web page counter
am 28.08.2007 03:10:08 von Jerry Stuckle
Michael Fesser wrote:
> .oO(Jerry Stuckle)
>
>> And BTW - I find those "counters" on a web page to be tacky. Kinda like
>> a prostitute bragging about how many tricks she turned.
>
> http://www.heise.de/ct/schlagseite/03/22/gross.jpg
>
> SCNR
> Micha
:-D
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: Help in trying to make a web page counter
am 28.08.2007 10:15:24 von gosha bine
On 27.08.2007 20:31 tedpottel@gmail.com wrote:
> Hi
> I'm trying to build a counter that will keep trach how many hits I got
> and where they came from. In my html pages I have a script of code
> that loads in an image. This image is a php file. When this file
> executes it adds one to the stack counter,
>
> The problem is that for the referring server, I alawyas get the server
> that is hosting the web page that is calling my web page counter. I'm
> assuming its because this is the server that calls the php code on my
> server.
>
> I have seen other companies do this, how do they do it????
>
They generate counter code with javascript, something like:
Using javascript also allows you to gather other info like screen
resolution, plugin versions etc.
--
gosha bine
makrell ~ http://www.tagarga.com/blok/makrell
php done right ;) http://code.google.com/p/pihipi
Re: Help in trying to make a web page counter
am 29.08.2007 04:40:38 von cathy
On Aug 27, 2:31 pm, "tedpot...@gmail.com" wrote:
> Hi
> I'm trying to build a counter that will keep trach how many hits I got
> and where they came from. In my html pages I have a script of code
> that loads in an image. This image is a php file. When this file
> executes it adds one to the stack counter,
>
> The problem is that for the referring server, I alawyas get the server
> that is hosting the web page that is calling my web page counter. I'm
> assuming its because this is the server that calls the php code on my
> server.
>
> I have seen other companies do this, how do they do it????
>
> This is what I have so far.
>
> On the client I insert the following code onto my web pages
>
>
> customer=3Dfred&phrase=3Dgoogle&server=3Dtedserve&filename=3 Dfred.html"
> alt=3D"boston kitchen design" width=3D"267" height=3D"90">
>
> Wherehttp://216.120.252.101/~multist/ws/add.phpis my php script to update
> the stat counter
>
> On my stat counter server,
>
> $from=3D$_SERVER['HTTP_REFERER'];
> // $from=3D'ted';
> $sql_string=3D"INSERT INTO `tedpott_webstat`.`web_stat` (";
> $sql_string=3D
> $sql_string."`customer`,`path_name`,`from_server`,`key_word_ phrase`,`Page=
ID=AD`,`server_name`,`file_name`)";
> $sql_string=3D$sql_string." VALUES (";
> $sql_string=3D$sql_string."'".$customer."','".$path."','".$f rom."','".
> $phrase."','".$pg."','".$server."','".$filename."'";
> $sql_string=3D$sql_string.")";
>
> print("
");
> print("
");
> print("second string b
");
> print($sql_string);
> print("
");
> if (!$results=3Dmysql_query($sql_string,$dblink))
> die("could not add new record");
> print("updateds database ok");
>
> // close databse connection
> mysql_close($dblink);.
Check out google analytics. Its simply a great tool!
Cathy
www.nachofoto.com
Re: Help in trying to make a web page counter
am 29.08.2007 11:57:30 von Michael Fesser
..oO(Cathy)
>Check out google analytics. Its simply a great tool!
It's also a great tool to slow down the download and rendering of a
page, like all external stat counters do.
I'm already thinking about blocking it in my router ...
Micha
Re: Help in trying to make a web page counter
am 03.09.2007 22:26:52 von j80k-vpfc
In article <1188239509.900179.100600@50g2000hsm.googlegroups.com>,
tedpottel@gmail.com () wrote:
> *Subject:* Help in trying to make a web page counter
> *From:* "tedpottel@gmail.com"
> *Date:* Mon, 27 Aug 2007 18:31:49 -0000
>
> Hi
> I'm trying to build a counter that will keep trach how many hits I
> got
> and where they came from. In my html pages I have a script of code
> that loads in an image. This image is a php file. When this file
> executes it adds one to the stack counter,
>
Much like the image at the bottom of www.g0lfp.com ?
sends a line to a flat file that shows..
1273=1294 : Wed, 29 Aug 2007 18:34:04 +0100 : 82.27.76.19 :
cpc1-hudd5-0-0-cust18.hudd.cable.ntl.com : http://www.qrz.com/callsign
Who and when, and where from. The rest of the info as stated elsewhere in
this thread is in the webstats.
- Steve