Topic awaiting preservation: php mysql problem (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: |
posted 07-27-2006 23:55
code: <?php header("Content-type: image/png"); $datab=mysql_connect("localhost", "db", "pass"); mysql_select_db("bloodonthecanvas_com_1"); $id=trim($id); $ip = GetHostByName($REMOTE_ADDR); MYSQL_QUERY("INSERT INTO `farrierhits` (`ip`) VALUES ('$ip')"); $vis=mysql_QUERY("SELECT COUNT(DISTINCT(`ip`)) FROM `farrierhits`"); $widthcalc=strlen($vis); $px = 7.5 * $widthcalc; $im = imagecreatefrompng("images/button1.png"); $orange = imagecolorallocate($im, 255, 0, 0 ); $font = imageloadfont("timesbd.ttf"); imagestring($im, $font+5, 0, 0, $vis, $orange); imagepng($im); mysql_close($datab); imagedestroy($im); ?>
|
Paranoid (IV) Inmate From: New Jersey, USA |
posted 07-28-2006 02:40
2 things. code: $widthcalc=strlen($vis);
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 07-28-2006 05:34
you're sure the image isn't on teh page twice? |
Bipolar (III) Inmate From: |
posted 07-28-2006 18:28
sorry, i was quite tired when i posted this |