PDA

View Full Version : ::Php GD help::



Kasabian
28-05-2006, 03:53 PM
Right, Well i want to display how many views i have had on my signature.

http://gfx.er1.be/sig.png

http://gfx.er1.be/sig.png/

Right, The php code is


<?php
header ("Content-type: image/png");
$img_handle = imagecreatefrompng ("mario.png");
$white = imagecolorallocate ($img_handle, 255, 255, 255);
$black = imagecolorallocate ($img_handle, 0, 0, 0);
$filename = "views.txt";
$fh = fopen($filename, "r");
$views = fread($fh, filesize($filename)+1);
fclose($fh);
imagestring ($img_handle, 10, 10, 50, "Views:", $black);
imagestring ($img_handle, 10, 65, 51, $views, $white);
imagepng ($img_handle);
imagedestroy($img_handle);
$fh2 = fopen($filename, "w");
$views2 = $views + 1;
fputs($fh2, $views2);
fclose($fh2);
?>

How do i move the number down to the blank space?

Cheers

Want to hide these adverts? Register an account for free!