这是我的代码.
function generate_card($card_number='',$card_price='',$card_expire='',$image_path='',$font_path)
{
// store image on variable //
$image = imagecreatefrompng($image_path);
// some text color
$color = imagecolorallocate($image, 255, 255, 0);
// print card price //
imagettftext($image, 15, 0, 200, 40, $color, $font_path, $card_price);
// print card number //
imagettftext($image, 15, 0, 15, 85, $color, $font_path, $card_number);
// print expiry date //
imagettftext($image, 12, 0, 145, 155, $color, $font_path, $card_expire);
header('Content-type:image/png');
imagepng($image);
imagedestroy($image);
}
generate_card('1234 5678 9101 1121','$200','12/13','card.png','verdana.ttf');
?>
我正在生成签证礼品卡,图片也在页面上创建和显示.但我的问题是,当我想在Mozilla中保存这个图像时,它会给出“page_name.png”,在IE中它给了我“无标题”.
如何在保存时给出自己的名字,如“visa_gift_01.png”.