ok, please could I have some help? I am creating a counter system to be downloaded for free (see sig) I am working on version 2 and i m stuck.
I need to combine a variable number of images with a variable height + width.
The runthrough:
$count is loaded from the count.php file ()
$style is the folder if the image set to load. Found in config.php ()
require('config.php')
require('count.php')
header("Content-type: image/png")
header('Cache-Control: no-cache, must-revalidate')
header('Pragma: no-cache')
if(!$_GET['nocount'])
{
$count = $count + 1;
$handle = fopen('count.php', 'w')
$count_add = '';
fwrite($handle, $count_add)
}
$number = str_split($count, 1)
$im = imagecreatefrompng('style/' . $style . '/left.png')
foreach($number as $n)
{
$number_add = imagecreatefrompng ('style/' . $style . '/' . $n . '.png')
$insert_x = imagesx($number_add)
$insert_y = imagesy($number_add)
$x = imagesx($im) + $insert_x;
imagecopymerge($im,$number_add,$x,0,0,0,$insert_x,$insert_y,100)
}
$number_add = imagecreatefrompng ('style/' . $style . '/right.png')
$insert_x = imagesx($number_add)
$insert_y = imagesy($number_add)
$x = imagesx($im) + $insert_x;
imagecopymerge($im,$number_add,$x,0,0,0,$insert_x,$insert_y,100)
imagepng($im)
imagedestroy($im)
?>
This code will reconise and load the diffrent numbers in $count as I have tested it with echo(). BUT it will only output the first image ($im = imagecreatefrompng('style/' . $style . '/left.png') wink
So I think the error is on the last 2 lines of the foreach() loop but I have never used the php image functions nuch before and so are unfimlar with them.
Please could someone help. Thanks.
PS: I am using PHP 5.X (not 100% sure)