this is the shape_cls.php
<?
class shape{
function connect(){
include("dbConnect.php");
$show = new dbConnect();
$connection = $show->connect();
// Select Data...
$s = OCIParse($connection, "select male from gender");
OCIExecute($s, OCI_DEFAULT);
while (OCIFetch($s)) {
$countMen = ociresult($s, "MALE");
}
//return the var to use within other functions
return $countMen;
}
function square($countMen){
$image = imagecreate(20,$countMen);
$maroon = ImageColorAllocate($image,100,0,0);
$white = ImageColorAllocate($image,255,255,255);
ImageFilledRectangle($image,50,50,10,10,$maroon);
header ("Content-type: image/png");
ImagePng($image);
ImageDestroy($image);
}
}
?>
This is dShape.php
<?
require "shape_cls.php";
$show = new shape();
$countMen = $show->connect();
$show->square($countMen);
?>
All i get is
connected‰PNG IHDRÍpPLTEdÿÿÿ6¼Ò‘ IDATxœcÀ}þîIEND®B‚
The connected is a string returned from my database class connection. the sysmbols are obviously the PNG image.
Any ideas?
slh