下面是我的代碼顯示圖像的信息,包括它的文件,但這不顯示,我不知道爲什麼。請幫助我們。圖像不顯示使用php mysql
<?php
include('config/dbconnect.php');
if(isset($_GET['id']))
{
$id = $_GET['id'];
$sql = mysqli_query($con, "SELECT * FROM collage WHERE id = '$id'");
while($row = mysqli_fetch_array($sql)) {
$name = $row['name'];
$content = $row['content'];
$size = $row['size'];
$type = $row['type'];
$date_upload = $row['date_upload'];
$file = $row['file'];
}
}
?>
<div class='body-content'>
<div class='img-name-cont'><h3><?php echo $name; ?></h3></div>
<div class='img-detail-cont'>upload: <?php echo $date_upload; ?><br>type: <?php echo $type; ?><br>size: <?php echo $size; ?>KB </div>
<div class='img-file-cont'>
<img src="img/collage/<?php echo $row['file'] ?>" style="width:130px; height:100%"></div>
<div class='img-content-cont'><?php echo $content; ?></div>
</div>
查看頁面源 - 是HTML正確 – 2016-07-08 04:01:53
你得到的代碼檢查?? PS任何錯誤代碼:你的代碼可以通過SQL注入 –
注射後' <?php' add'error_reporting(E_ALL); ini_set('display_errors' ,1);'並寫入'$ sql = mysqli_query($ con,「SELECT * FROM collage WHERE id ='$ id'」)或死(mysqli_error($ con));'並檢查錯誤 –