You are here: Help in trying to make a web page counter « PHP Programming Language « IT news, forums, messages
Help in trying to make a web page counter

Posted by tedpottel@gmail.com on 08/27/07 18:31

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

<img src="http://216.120.252.101/~multist/ws/add.php?
customer=fred&phrase=google&server=tedserve&filename=fred.html"
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."','".$from."','".
$phrase."','".$pg."','".$server."','".$filename."'";
$sql_string=$sql_string.")";

print("<br>");
print("<br>");
print("second string b<br>");
print($sql_string);
print("<br>");
if (!$results=mysql_query($sql_string,$dblink))
die("could not add new record");
print("updateds database ok");


// close databse connection
mysql_close($dblink);.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация