".$config['rrdtool'] . " graph $graphfile $rrd_options"); } $thing = shell_exec($config['rrdtool'] . " graph $graphfile $rrd_options"); if(is_file($graphfile)) { header('Content-type: image/png'); echo(`cat $graphfile`); } else { header('Content-type: image/png'); $string = "Graph Generation Error"; $im = imagecreate($width, $height); $orange = imagecolorallocate($im, 255, 255, 255); $px = (imagesx($im) - 7.5 * strlen($string)) / 2; imagestring($im, 3, $px, $height / 2 - 8, $string, imagecolorallocate($im, 128, 0, 0)); imagepng($im); imagedestroy($im); } } if($graph) { header('Content-type: image/png'); echo(`cat $graphfile`); } else { header('Content-type: image/png'); $string = "Graph Generation Error"; $im = imagecreate($width, $height); $orange = imagecolorallocate($im, 255, 255, 255); $px = (imagesx($im) - 7.5 * strlen($string)) / 2; imagestring($im, 3, $px, $height / 2 - 8, $string, imagecolorallocate($im, 128, 0, 0)); imagepng($im); imagedestroy($im); } $delete = `rm $graphfile`; # } // End IF ?>