Hi
I have this code :
The $test while bit is just a test, to see if it loops more than once, which it doesn't.
Basically, it should update hits to hits + 1 yeh? Well ... it does hits + 2.
(ie, i go to the page with the image, it should add 1 to the hits, but instead it adds 2 every time. i cant work out why)
Any ideas?
BTW it *seems* to work fine if i take out the image bits (the header/read file lines).
I have this code :
PHP:
mysql_connect($url,$username,$password);
@mysql_select_db($db) or die( "Unable to select database");
if (isset($_REQUEST['uid']))
{
$uidd = strip_tags($_REQUEST['uid']);
Header("Content-type: image/gif");
readfile('sample.gif');
$test = '1';
while ($test == '1') {
mysql_query("UPDATE counter SET hits=hits+1 WHERE uid = '$uidd'");
$test = 0;}
}
Basically, it should update hits to hits + 1 yeh? Well ... it does hits + 2.
(ie, i go to the page with the image, it should add 1 to the hits, but instead it adds 2 every time. i cant work out why)
Any ideas?
BTW it *seems* to work fine if i take out the image bits (the header/read file lines).
Last edited: