1

pCharts のドキュメントによると、このコードを使用してブラウザに画像をレンダリングできるはずです。

mypic.php

$myPicture->stroke;

mypage.html

<IMG SRC=‘mypic.php‘&gt;

このimgタグは、php スクリプトを呼び出すことになっています。PHP スクリプト内で、ストローク関数はcontent-type: image/png.

だからここに私が持っているものがあります:

netsales.php

<?php
     include('../class/pData.class.php');
     include('../class/pDraw.class.php');
     include('../class/pImage.class.php');

     /* query sales and 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>

エラーは発生しません。画像が見つからない場合は赤い X が表示されます。

4

3 に答える 3

1

を削除してみてください

<?php
     include ('netsales.php');
?>

index.php から、追加します

header('Content-Type: image/png');

Stroke 呼び出しの前。

于 2011-05-27T13:21:23.470 に答える
0

HTMLファイルにコメントインクルード機能がありました:

<?php //include ('my.php'); ?>
于 2013-09-12T09:26:34.637 に答える