Mysqli Formu Post Edemiyorum
- Formu post edemiyorum. Düzenle dediğimde hiçbir değişiklik olmuyor. Kodlar aşağıdaki gibidir.
Panel fotoğrafı en alt kısımdadır.
PHP Kodları
<! PHP Düzenleme Başlangıç !> <?php if (isset($_POST["edit_portfolio"])){ $portfolio_name = $_POST["portfolio_name"]; $portfolio_text = $_POST["portfolio_text"]; $portfolio_category = $_POST["portfolio_category"]; $portfolio_image = $_FILES["image"]["name"]; $portfolio_image_temp = $_FILES["image"]["tmp_name"]; move_uploaded_file($portfolio_image_temp, "../img/$portfolio_image"); $sql_query2 = "UPDATE portfolios SET portfolio_name = '{$portfolio_name}', portfolio_text = '{$portfolio_text}', portfolio_category = '{$portfolio_category}', portfolio_img = '{$portfolio_image}', WHERE portfolio_id = '$_POST[portfolio_id]'"; $edit_portfolio_query = mysqli_query($conn, $sql_query2); header("Location: calismalarim.php"); } ?> <! PHP Düzenleme Bitiş !>
HTML Kodları
<! HTML Düzenleme Alanı Başlangıç !>
<div id="edit_modal<?php echo $k; ?>" class="modal fade">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Çalışma Düzenle</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="portfolio_name">Çalışma Adı</label>
<input type="text" class="form-control" name="portfolio_name" value="<?php echo $portfolio_name; ?>">
</div>
<div class="form-group">
<label for="portfolio_text">Açıklama</label>
<div class="form-group">
<textarea class="form-control md-textarea" rows="10" name="portfolio_text"><?php echo $portfolio_text; ?></textarea>
</div>
<div class="form-group">
<label for="portfolio_category">Kategori</label><br>
<select class="form-group browser-default custom-select mb-4" name="portfolio_text">
<?php
$edit_category_sql = "SELECT * FROM categories";
$edit_category_run = mysqli_query($conn, $edit_category_sql);
while($edit_category_row = mysqli_fetch_assoc($edit_category_run)){
$edited_category = $edit_category_row["category_name"];
echo"<option>$edited_category</option>";
}
?>
</select>
</div>
<div class="form-group">
<img src="../img/<?php echo $portfolio_img; ?>" width="100%" height="150px">
<input type="file" class="form-control" name="image">
</div>
<div class="form-group">
<input type="hidden" name="portfolio_id" value="<?php echo $row["portfolio_id"]; ?>">
<input type="submit" class="btn btn-primary" name="edit_portfolio" value="Düzenle">
</div>
</form>
</div>
</div>
</div>
</div></div>
<?php $k++; } ?>
<! HTML Düzenleme Alanı Bitiş !>
- Panel görseli aşağıdadır.