那么,Painty 应该是产生的图像。请确保您已正确设置你的头,按painty.php的说明:
$config = array(
'input' => $_GET['html'],
'output' => "png",
'width' => 400,
'height' => 300,
'font_path' => "./",
'font' => "tahoma.ttf",
'font_bold' => "tahoma.ttf",
'' => ''
);
$str = $config['input'];
if(get_magic_quotes_gpc())
{
$str = stripslashes($str);
}
$im = painty($str);
//Set header. secured from header injection.
最重要的部分:
header("Content-Type: image/".str_replace("\r\n", "", $config['output']));
imagepng($im);
的header
命令告诉服务器到文件当作图像 - 即使它可能被命名为image-generator.php
。如果你将这个文件看作一个形象,以及,它应该是罚款:
<a href="image-generator.php?username=foo&level=36&class=Demoman">
<img src="image-generator.php?username=foo&level=36&class=Demoman" />
</a>
这是假设image-generator.php
已被设置为接受$ _ POST数据。然后image-generator.php
从该数据创建一个HTML文件,并将其作为输入发送给Painty。
祝你好运!