note 28995 deleted from function.imagejpeg by jsheets

From: Date: Thu, 30 Jan 2003 02:15:35 +0000
Subject: note 28995 deleted from function.imagejpeg by jsheets
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-43107@lists.php.net to get a copy of this message
I am fairly new to PHP, but have done enough C to know my way around the language syntax. MY problem though, is one of lack of experience with PHP/GD to know what I am doing wrong here. I am trying to write a page counter that loads predefined jpeg digits as the image resource. but for some reason I cannot seem to display more than one digit image at any given time in the browser. What have I overlooked? A snipet of the vital code is shown below. If anyone has any suggestions I would love to hear them. Thanks This is in my HTML file that calls it; .....previous stuff removed <body bgcolor="#ffffff"> <img src="scripts/counter.php"> </body> </html> This is in my PHP file; .....file I/O routine left out also display_count($countVal); function display_count($count) { for ($idx = 1; $idx <= strlen($count); $idx++) { $digitValStr = substr($count, $idx, 1); $digitVal = intval($digitValStr); $imgFilename = "$digitValStr.jpg"; header("Content-type: image/jpeg"); $digitsImg[$digitVal] = imagecreatefromjpeg($imgFilename); imagepng($digitsImg[$digitVal]); imagedestroy($digitsImg[$digitVal]); } }

« previous php.notes (#43107) next »