1 回答

TA貢獻(xiàn)1795條經(jīng)驗(yàn) 獲得超7個(gè)贊
基本上,您需要在anchor標(biāo)簽上創(chuàng)建一個(gè)鏈接,該鏈接將包含url圖像詳細(xì)頁(yè)面,image id如下所示:
while ($row = mysqli_fetch_assoc($result)) {
// assuming that imgId is your primary key
echo '<a href="detail.php?imageId="'.$row["imgId"].' target="_blank">
<div style="background-image: url(img/gallery/'.$row["imgFullNameGallery"].');"></div>
<h3>'.$row["titleGallery"].'</h3>
<p>'.$row["descGallery"].'</p>
</a>';
}
之后,您需要?jiǎng)?chuàng)建一個(gè)新文件detail.php,您可以image id通過(guò)該文件進(jìn)行$_GET['imgId']查詢(xún),然后將能夠獲得完整的圖像詳細(xì)信息。您還需要?jiǎng)?chuàng)建一個(gè)HTML視圖并可以顯示詳細(xì)信息。
希望對(duì)你有幫助?。?/p>
- 1 回答
- 0 關(guān)注
- 236 瀏覽
添加回答
舉報(bào)