我有一個PHP腳本,由HTML創建,並從我的網站連接的靜態圖像時,其輸出到.doc
生成word文檔生成的圖像,該圖像在Microsoft Word 03,並加載罰款但是,當試圖使用URL生成圖像時(通過解析它的參數),圖像似乎不會加載。PHP HTML Word文檔不顯示通過URL
header('Content-type: application/ms-word');
header('Content-Disposition: attachement;filename="report.doc"');
header('Content-Transfer-Encoding: binary');
print($output);
繼承人什麼,我試圖做的,我有一個URL(website.com/signature.php?form=XXXX),其中XXX
的形式ID。 signature.php需要在ID nunmber,找到存儲在服務器上的JSON,並從JSON文件生成一個圖像,使用這個jQuery插件http://thomasjbradley.ca/lab/signature-to-image/
簽名/圖像轉換罰款,我看到它,當我測試它一些例子,但是當打開文件時,它不顯示。
<img style="display: block;" alt = "" width="200" height="74" src = "http://myWebsite.net/signature.php?form=' . $results[$i]['id'] . '" />
這就是我對我的HTML。
編輯:
在我signature.php我有以下幾點:
require("DB/DBConnection.php");
require("signature-to-image.php");
$formID = $_REQUEST['form'];
$dbh = DBConnection::connection();
$sql = "SELECT signature FROM forms where id = ?";
$stmt = $dbh->prepare($sql);
$stmt->bindValue(1, $formID, PDO::PARAM_STR);
$stmt->execute();
$result = $stmt->fetch();
if ($result != null) {
$img = sigJsonToImage($result['signature']);
header('Content-Type: image/jpeg');
imagejpeg($img);
imagedestroy($img);
}
是你寫的實際html嗎?或者是寫html的PHP的一部分? – 2013-03-20 23:59:31
@MarkBaker它是寫入html的php的一部分。 '$ output。=
'是我所擁有的,以及一大堆我沒有添加到OP –
SNpn
2013-03-21 00:11:13