Sunucuma bir resim yüklemek için bir PHP betiği yazmaya çalışıyorum ve resim tablosunu bir Veritabanı tablosu satırında gösteriyorum. Bir dosya yükleme komut dosyası oluşturdum ve görüntü dosyasının sunucuya başarıyla yüklendiğini fark ettim ve ayrıca görüntünün dosya adını phpMyAdmin'de de görebiliyorum. Sorun şu ki, şimdi veritabanı sayfamı görüntülemek için tarayıcımda sayfam yüklenmeyecek. "Web sayfası çalışmıyor ve web sayfasının şu anda bu isteği 500 işleyemediği" yazıyor. Dosya yükleme için oluşturduğum if ifadesini kaldırdığımda, web sayfası veritabanı tablosunu gösterir, ancak silinmiş olduğu için dosya görüntüsünü göstermez. Komut dosyasında if ifadesini bıraktığımda dosya yükleme işlemi iyi çalışıyor, ancak tekrar web sayfası yükleme hatası almaya devam ediyorum. Bu senaryo.Bir tablo satırının içine resim yüklemek için PHP betiğini yazdım. Çalışıyor ama şimdi Web Sayfası tabloyu görüntülemek için yüklenmiyor
echo '<table id="output" border="1">
<tr>
<th>ID</th>
<th>Sq. Ft.</th>
<th>Price</th>
<th>Street Address</th>
<th>Bedrooms</th>
<th>Baths</th>
<th>Finished Basement</th>
<th>Fence</th>
<th>Pool</th>
<th>Year Built</th>
<th>Featured</th>
<th>Homes</th>
</tr>';
$increment = 0; //declare and initialize a count variable to keep track of the rows we selected
while ($row = mysqli_fetch_array($result)) { //build form from selected homes
echo '<tr>
<td><center>' . $row['id'] . '</center></td>
<td> ' . $row['sf'] . '</td>
<td> ' . $row['price'] . '</td>
<td> ' . $row['street_address'] . '</td>
<td> ' . $row['bedrooms'] . '</td>
<td> ' . $row['baths'] . '</td>
<td> ' . ($row['finished_basement']?'Yes':'No') . '</td>
<td> ' . ($row['fence']?'Yes':'No') . '</td>
<td> ' . ($row['pool']?'Yes':'No') . '</td>
<td> ' . $row['year_built'] . '</td>
<td> ' . $row['featured'] . '</td>
<td>'if (is_file(GW_UPLOADPATH . $row['homes']) && filesize(GW_UPLOADPATH . $row['homes']) > 0) {
echo <td>'<img src="' . GW_UPLOADPATH . $row['homes'] . '" alt="Picture of Home" />'</td>;
}
else {
echo <td>'<img src="' . GW_UPLOADPATH . 'missingimg.jpg' . '" alt="No Image" />'</td>;
}
'</tr>';
$increment = $increment + 1; // add one to the counter for each row put into the table
}
echo '<p id="row_info">CHECK OUT OUR ' . $increment . ' FEATURED LISTINGS!!!</p><br />';
echo '</table>';