php - pChart does not render to web browser, only shows missing image -
pcharts documentation says should able render image browser using code.
mypic.php
$mypicture->stroke;
mypage.html
<img src=‘mypic.php‘>
the img
tag supposed invoke php script. within php script, stroke function sets content-type: image/png
.
so here have:
netsales.php
<?php include('../class/pdata.class.php'); include('../class/pdraw.class.php'); include('../class/pimage.class.php'); /* query sales , create new image */ $mypicture->stroke; ?>
index.php
<?php include ('netsales.php'); ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> <div> <img src="netsales.php" /> </div> </body> </html>
i'm not getting errors, red x missing image.
try removing the
<?php include ('netsales.php'); ?>
from index.php, , add
header('content-type: image/png');
before stroke call.
Comments
Post a Comment