我寫了一個代碼,它是引導網格style.But回顯圖像路徑和顯示在網站上,但它沒有顯示圖像。代碼工作正常,請幫助我。這裏是我的代碼圖像src與php變量不會顯示在網頁上的圖像
<div class="row">
<?while ($row = mysql_fetch_assoc($query)) {?>
<div class = "col-md-3">
<?php echo $row['keywords'];?>
<?php $imagePath = $row['video_url'];?>
<?php echo $imagePath;?>
<div id="video_thumbnail">
<a href="#" class="thumbnail">
<?php echo '<img src="' . $imagePath . '">'; ?>
<img src="<?php echo file_dir . '/' . $imagePath; ?>" height="100" width="100"/>
</a>
</div>
</div>
<?php } ?>
</div>
'<?php echo''; ?>這條線是什麼? – pmahomme
右擊檢查圖片上的檢查元素,並檢查 – Ghost
好吧,我做到了。感謝@Ghost。這是一個錯誤的路徑。因爲我將路徑設置爲/opt/lampp/htdocs/video_frames/imge.jpg,但它在localhost服務器上運行,所以我將路徑設置爲/video_frames/image.jpg。現在它工作正常。謝謝大家。 –