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

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -