我正在创建一个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