Hi, I dont know if this is the right place for my question but if anybody can help me ?<br /><br />I put ads of my friends' web sites into my web site (and also into the forum). If the file I put is SWF type I can easily saw from cPanel Statistic, how many times it was loaded or clicked. But I can not do the same thing for JPG or GIF files. Is there a way to do this ? <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/wallbash.gif" style="vertical-align:middle" emoid=":wallbash:" border="0" alt="wallbash.gif" /> <br /><br />Thank you<br /><br />www.osmanliparalari.com<!--content-->
Welcome to the forums OttomanCoins <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /> <br /><br />Basically you will need to either use a script (which is effectively what is in the swf files) or you will need to analyze your log files. <br /><br />Other than that, I'm not aware of a way to automatically get the information from a straight image file such as a gif or jpg.<!--content-->
Welcome to the forums OttomanCoins <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><!--content-->
Thank you for warm welcomes <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/tchrocks!.gif" style="vertical-align:middle" emoid=":tchrocks!:" border="0" alt="tchrocks!.gif" /> <br /><br />Do you know any good web log analyzers ?<!--content-->
Welcome to the forums OttomanCoins <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /> <br />Have you looked at hotscripts.com for a Click Tracker script?<!--content-->
<a href="http://www.weblogexpert.com/index.htm" target="_blank">WebLog Expert</a><!--content-->
Welcome to the forum, OttomanCoins. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><!--content-->
Here's an example of a script I use to keep track of page reads. It uses php-gd, a 1x1 pixel transparent pixel and an alteration to my .htaccess file so I can name the file whatever.png and it still executes as a php script. The only output of the script is the blank.png and the rest is just commands that are executed in the background every time the page loads with the blank.png in it. In your case, you could have it output the ad image and for the link, you could redirect it to another php page briefly that logs the click then redirects them to the ad's site. That way you would have a log of views and a log of clicks. My particular script just creates and updates a counter file and a file that keeps track of ip addresses so I'm not counting the same ip address twice (in case the viewer leaves the page and comes back). <br />I could easily update this script for you to do what you need if you like it. Here's my script as I use it:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br /><br />$counter_file = "counter6.txt";<br />$ipaddresses = "ipaddresses6";<br />$script = "Fibonacci";<br />$submitted_email="[email protected]";<br />$to_email="[email protected]";<br /><br />if (getenv("HTTP_CLIENT_IP")) {<br />Â Â Â Â $ip = getenv("HTTP_CLIENT_IP");<br />Â Â Â Â } <br />Â Â Â Â else if (getenv("HTTP_X_FORWARDED_FOR")) {<br />Â Â Â Â Â Â Â Â Â Â Â Â $ip = getenv("HTTP_X_FORWARDED_FOR");<br />Â Â Â Â Â Â Â Â Â Â Â Â } <br />Â Â Â Â else if(getenv("REMOTE_ADDR")) {<br />Â Â Â Â Â Â Â Â Â Â Â Â $ip = getenv("REMOTE_ADDR");<br />Â Â Â Â Â Â Â Â Â Â Â Â } <br />Â Â Â Â else {<br />Â Â Â Â Â Â Â Â Â Â $ip = "UNKNOWN";<br />Â Â Â Â Â Â Â Â }<br /><br />$isthere = "0";<br />$somecontent = "$ip\n";<br /><br />$filestuff = file("$ipaddresses");<br /><br />foreach ($filestuff as $line_num => $line) {<br />Â Â $line = trim($line);<br />Â Â $ip = trim($ip); <br />Â Â if ($line === $ip)<br />Â Â Â Â Â Â {<br />Â Â Â Â Â Â $isthere = 1;<br />Â Â Â Â Â Â }<br />Â Â }<br /><br />if ($isthere == "0"){<br />Â Â Â Â if (is_writable($ipaddresses)) {<br />Â Â Â Â Â Â Â Â if (!$handle = fopen($ipaddresses, 'a')) {<br />Â Â Â Â Â Â Â Â Â Â Â Â echo "Cannot open file ($ipaddresses)";<br />Â Â Â Â Â Â Â Â Â Â Â Â exit;<br />Â Â Â Â Â Â Â Â Â Â Â Â }<br />Â Â Â Â Â Â Â Â if (fwrite($handle, $somecontent) === FALSE) {<br />Â Â Â Â Â Â Â Â Â Â Â Â echo "Cannot write to file ($filename)";<br />Â Â Â Â Â Â Â Â Â Â Â Â exit;<br />Â Â Â Â Â Â Â Â Â Â Â Â }<br />Â Â Â Â Â Â Â Â }<br />Â Â Â Â <br />Â Â Â Â // Open the file for reading<br />Â Â Â Â if (!($fp = fopen($counter_file, "r"))) die ("Cannot Open Counter file: $counter_file.");<br /><br />Â Â Â Â // Read 20 characters from the file<br />Â Â Â Â $counter = (int) fread($fp, 20);<br /><br />Â Â Â Â // Close the file<br />Â Â Â Â fclose($fp);<br /><br />Â Â Â Â // Increment the counter<br />Â Â Â Â $counter++;<br /><br />Â Â Â Â // Open the file, in write mode<br />Â Â Â Â $fp = fopen($counter_file, "w");<br /><br />Â Â Â Â // Write the new value of counter to the file.<br />Â Â Â Â fwrite($fp, $counter);<br /><br />Â Â Â Â // Close the text file.<br />Â Â Â Â fclose($fp);<br />Â Â Â Â $hostname = gethostbyaddr($ip);<br />Â Â Â Â <br />Â Â Â Â mail("$to_email", "Someone viewed $script", "IP address: $ip\nHostname: $hostname\nIt has now been viewed $counter times. Cool!\n","From: $submitted_email") or die("error");<br />Â Â Â Â }<br />Â Â Â Â <br />Â Â <br />//ini_restore(sendmail_from);<br /><br />Header ("Content-type: image/png");<br />Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");<br />Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");<br />Header("Pragma: no-cache");<br /><br />$img = @ImageCreatefromPNG("blank.png");<br />ImagePNG($img);<br /><br />ImageDestroy($img);<br /><br />?><!--c2--></div><!--ec2--><br /><br />Of course, if you have a lot of banners/ads, you may want to keep track of the statistics in a database rather than a flat file like I do here.<!--content-->
I am now trying weblogexpert. I think this will do the job. If not, I will ask more help from you.<br /><br />Thank you for all your help. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/clapping.gif" style="vertical-align:middle" emoid=":clapping:" border="0" alt="clapping.gif" /><!--content-->
Welcome to the forums OttomanCoins <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /> <br /><br />Basically you will need to either use a script (which is effectively what is in the swf files) or you will need to analyze your log files. <br /><br />Other than that, I'm not aware of a way to automatically get the information from a straight image file such as a gif or jpg.<!--content-->
Welcome to the forums OttomanCoins <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><!--content-->
Thank you for warm welcomes <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/tchrocks!.gif" style="vertical-align:middle" emoid=":tchrocks!:" border="0" alt="tchrocks!.gif" /> <br /><br />Do you know any good web log analyzers ?<!--content-->
Welcome to the forums OttomanCoins <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /> <br />Have you looked at hotscripts.com for a Click Tracker script?<!--content-->
<a href="http://www.weblogexpert.com/index.htm" target="_blank">WebLog Expert</a><!--content-->
Welcome to the forum, OttomanCoins. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><!--content-->
Here's an example of a script I use to keep track of page reads. It uses php-gd, a 1x1 pixel transparent pixel and an alteration to my .htaccess file so I can name the file whatever.png and it still executes as a php script. The only output of the script is the blank.png and the rest is just commands that are executed in the background every time the page loads with the blank.png in it. In your case, you could have it output the ad image and for the link, you could redirect it to another php page briefly that logs the click then redirects them to the ad's site. That way you would have a log of views and a log of clicks. My particular script just creates and updates a counter file and a file that keeps track of ip addresses so I'm not counting the same ip address twice (in case the viewer leaves the page and comes back). <br />I could easily update this script for you to do what you need if you like it. Here's my script as I use it:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br /><br />$counter_file = "counter6.txt";<br />$ipaddresses = "ipaddresses6";<br />$script = "Fibonacci";<br />$submitted_email="[email protected]";<br />$to_email="[email protected]";<br /><br />if (getenv("HTTP_CLIENT_IP")) {<br />Â Â Â Â $ip = getenv("HTTP_CLIENT_IP");<br />Â Â Â Â } <br />Â Â Â Â else if (getenv("HTTP_X_FORWARDED_FOR")) {<br />Â Â Â Â Â Â Â Â Â Â Â Â $ip = getenv("HTTP_X_FORWARDED_FOR");<br />Â Â Â Â Â Â Â Â Â Â Â Â } <br />Â Â Â Â else if(getenv("REMOTE_ADDR")) {<br />Â Â Â Â Â Â Â Â Â Â Â Â $ip = getenv("REMOTE_ADDR");<br />Â Â Â Â Â Â Â Â Â Â Â Â } <br />Â Â Â Â else {<br />Â Â Â Â Â Â Â Â Â Â $ip = "UNKNOWN";<br />Â Â Â Â Â Â Â Â }<br /><br />$isthere = "0";<br />$somecontent = "$ip\n";<br /><br />$filestuff = file("$ipaddresses");<br /><br />foreach ($filestuff as $line_num => $line) {<br />Â Â $line = trim($line);<br />Â Â $ip = trim($ip); <br />Â Â if ($line === $ip)<br />Â Â Â Â Â Â {<br />Â Â Â Â Â Â $isthere = 1;<br />Â Â Â Â Â Â }<br />Â Â }<br /><br />if ($isthere == "0"){<br />Â Â Â Â if (is_writable($ipaddresses)) {<br />Â Â Â Â Â Â Â Â if (!$handle = fopen($ipaddresses, 'a')) {<br />Â Â Â Â Â Â Â Â Â Â Â Â echo "Cannot open file ($ipaddresses)";<br />Â Â Â Â Â Â Â Â Â Â Â Â exit;<br />Â Â Â Â Â Â Â Â Â Â Â Â }<br />Â Â Â Â Â Â Â Â if (fwrite($handle, $somecontent) === FALSE) {<br />Â Â Â Â Â Â Â Â Â Â Â Â echo "Cannot write to file ($filename)";<br />Â Â Â Â Â Â Â Â Â Â Â Â exit;<br />Â Â Â Â Â Â Â Â Â Â Â Â }<br />Â Â Â Â Â Â Â Â }<br />Â Â Â Â <br />Â Â Â Â // Open the file for reading<br />Â Â Â Â if (!($fp = fopen($counter_file, "r"))) die ("Cannot Open Counter file: $counter_file.");<br /><br />Â Â Â Â // Read 20 characters from the file<br />Â Â Â Â $counter = (int) fread($fp, 20);<br /><br />Â Â Â Â // Close the file<br />Â Â Â Â fclose($fp);<br /><br />Â Â Â Â // Increment the counter<br />Â Â Â Â $counter++;<br /><br />Â Â Â Â // Open the file, in write mode<br />Â Â Â Â $fp = fopen($counter_file, "w");<br /><br />Â Â Â Â // Write the new value of counter to the file.<br />Â Â Â Â fwrite($fp, $counter);<br /><br />Â Â Â Â // Close the text file.<br />Â Â Â Â fclose($fp);<br />Â Â Â Â $hostname = gethostbyaddr($ip);<br />Â Â Â Â <br />Â Â Â Â mail("$to_email", "Someone viewed $script", "IP address: $ip\nHostname: $hostname\nIt has now been viewed $counter times. Cool!\n","From: $submitted_email") or die("error");<br />Â Â Â Â }<br />Â Â Â Â <br />Â Â <br />//ini_restore(sendmail_from);<br /><br />Header ("Content-type: image/png");<br />Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");<br />Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");<br />Header("Pragma: no-cache");<br /><br />$img = @ImageCreatefromPNG("blank.png");<br />ImagePNG($img);<br /><br />ImageDestroy($img);<br /><br />?><!--c2--></div><!--ec2--><br /><br />Of course, if you have a lot of banners/ads, you may want to keep track of the statistics in a database rather than a flat file like I do here.<!--content-->
I am now trying weblogexpert. I think this will do the job. If not, I will ask more help from you.<br /><br />Thank you for all your help. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/clapping.gif" style="vertical-align:middle" emoid=":clapping:" border="0" alt="clapping.gif" /><!--content-->