Forum Moderators: coopster
I can't get this darn thing to work..
what I'm trying to create, is a method for counting views on my pic's. the idea is that I have an image, let's say [mydomain.com...] and when the user goes to that image, a mysql counter would add a value to a database, and show the user the image as it normaly does.
my setup is:
i'm using the rewrite engine, and the test image is setup like this:
RewriteRule ^egypt.jpg$ count.php [L]
count.php looks like this:
<?
ob_start();
mysql_add..stuff here
header( "Content-type: image/jpeg" );
@readfile(egypt.jpg);
?>
everything works, but the issue is that instead of the image showing up, i just get this text:
[mydomain.com...]
I tried making the count.php, instead of the readfile(), doing a print "<img.."; and it shows up if i go directly to it, but then if I try to add this image to let's say a forum, the image doesn't show up.
i've seen people at forums that have an image with a similar concept. the image is a counter, and every time someone saw it the counter would add 1 and show it.
hope someone understood my problem and could help me ;) thanks