   Testing post counter script.
  Just wrote a post counter in PHP, testing it out.   "There aint gonna be no tea and crumpets!"You are person # to view this post. 
  yay. ;  Make sure you post the code (since it seems to work).Am I to assume that the code uses the referrer information to have a unique post count for the different threads?  How would this function if you had more than one post in a thread?   |.dev-c++.|.the gimp.|.seti@home.|.dbpoweramp.|.torn.|.=w=.| ;  It dues use the referer info to create the record for each thread, each thread's post count is shared, but then again, if you view one of my posts in a thread you will have to view them all.If I really cared I would also add a lookup table of ip addresses that have viewed the thread so I could only record each viewer once, but that is too much like work.Edit: I'll post the code once I get home, I don't know how to copy more than one line at a time over SSH.   [edited by - griffenjam on August 4, 2003 6:01:49 PM];  Now everyone can tell me how much I suck at PHP <?php   header("Content-type: image/jpeg");   $im = imagecreate(40, 15);   $black = ImageColorAllocate($im, 0,0,0);   $white = ImageColorAllocate($im, 255, 255, 255);//Connect to database   $ref = $_SERVER[''HTTP_REFERER''];   $query = "SELECT * FROM count WHERE Ref = ''$ref'';";   $username="username";   $password="password";   $database="postcounter";   mysql_connect(localhost, $username, $password);   @mysql_select_db($database) or die("Unable to open database");   $result = mysql_query($query);   $num=mysql_numrows($result);   $viewcount = 0;   if($num == 0)   { //Create a new row $query = "INSERT INTO count VALUES(''$ref'', 1);"; $result = mysql_query($query);   }   else   { //Get the current count $viewcount = mysql_result($result, 0, "count"); //increment count $viewcount = $viewcount + 1; $query = "UPDATE count SET count = $viewcount;"; $result = mysql_query($query);   }    ImageString($im, 3, 0, 0, $viewcount, $white);   Imagejpeg($im);   ImageDestroy($im);    mysql_close();?> "There aint gonna be no tea and crumpets!"You are person # to view this post. ;  I stole your "post counter" to use on another site. KTHXBYE! ;  I don''t care, but there is something wrong it it. It you got to a page with one of your posts in it, then it your back button and make a post it seems that it somehow keeps the postcount value and applies it to the new thread. ohh well. 