Welcome to Gaia! ::

My Design :: Web and Graphic Design [HTML CSS PHP]

Back to Guilds

XHTML, CSS, jQuery, Javascript, PHP, mySQL, MORE! 

Tags: design, graphics, html, jquery, javascript 

Reply Server Side Programming
*sighs* Please could I have some~ it is ok now ^_^

Quick Reply

Enter both words below, separated by a space:

Can't read the text? Click here

Submit

Uru Wolf

PostPosted: Mon Apr 16, 2007 9:46 am


Dam I was one letter from finishing the subject (damn maxlength="" parameter)

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)
PostPosted: Mon Apr 16, 2007 11:50 am


Acually I think I have it now. Thanks anyway.

Uru Wolf


warzisback

PostPosted: Mon Jul 09, 2007 7:58 pm


User Image - Blocked by "Display Image" Settings. Click to show.
Reply
Server Side Programming

 
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum