我正在創建一個Web應用程序,用戶可以在其中上載/下載/查看在線PDF。我想更改PDF文件的名稱以在新標籤鏈接中查看(就像我們在所有網站中看到的一樣)。在PHP中查看PDF鏈接
有誰知道如何讓數據庫中的任何字段提供一個鏈接,當用戶點擊時,它打開一個新的標籤中的PDF?
if($result) {
if($result->num_rows == 0) {
echo '<p>There are no files in the database</p>';
}
else {
// Print the top of a table
echo '<table width="100%">
<tr>
<td><b>Name</b></td>
<td><b>type</b></td>
<td><b>Size (bytes)</b></td>
<td><b>Created</b></td>
<td><b> </b></td>
<td><b>view><b/></td>
</tr>';
// Print each file
while($row = $result->fetch_assoc()) {
echo "
<tr>
<td>{$row['name']}</td>
<td>{$row['type']}</td>
<td>{$row['size']}</td>
<td>{$row['created']}</td>
</tr>";
}
// Close table
echo '</table>';
}
// Free the result
$result->free();
}
else
{
echo 'Error! SQL query failed:';
echo "<pre>{$dbLink->error}</pre>";
}
// Close the mysql connection
$dbLink->close();
向我們展示來自'$ row'的示例數據 – webbiedave 2012-03-13 19:39:11