...

View Full Version : PHP poll with image output



haveacigar
03-27-2007, 12:58 AM
Hey, I'm staring a new project and i am trying to make an poll, which is fine, but what i need to do is have the results outputted into an image.

I havent been able to find anything like this on google so does anyone have any thoughts?

Cheers

Ciggy

Fumigator
03-27-2007, 01:23 AM
PHP has an image library called the GD library. The PHP manual can get you started on this page here (http://us2.php.net/manual/en/ref.image.php) and this one here (http://us2.php.net/manual/en/function.imagecreate.php).

aedrin
03-27-2007, 04:00 PM
The easiest way is to simply make a graphic that is the height of your percentage bars.

Then echo out the width of the image as the percentage.



foreach ($results as $result) {
echo '<img src="bar.gif" width="'.$result['percentage'].'" />';
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum