我正在尝试更新查询并显示到下一页。这是我的代码,问题是我将收到一条警告消息"无法修改标题信息 - 标题已经发送"。请帮忙。
$id = (isset($_GET['id'])) ? $_GET['id'] : '';
$val = view_data($id);
if (empty($_POST) === false) {
$title = $_POST["offered"];
$description = $_POST["description"];
$id = $_POST["id"];
$update = update($title, $description, $id);
if ($update) {
header("location:hotel2_galery.php");
}
}
HTML
<form action="hotel2_galery_edit.php" method="post" class="col-sm-4">
<div class="form-group has-info">
<input type="hidden" name="id" value="<?php echo $val->offer_id;?>">
<label class="control-label" for="inputSuccess">Offer title
</label>
<input type="text" class="form-control" name="offered" id="offered" value="<?php echo $val->offers_name; ?>">
<label>Offer Description
</label>
<textarea id="description" name="description" class="form-control " rows="3">
<?php echo $val->offers_description; ?>
</textarea>
<br>
<button type="submit" class="btn btn-primary">
<span>UPDATE
</span>
</button>
</div>
</form>
答案 0 :(得分:0)
尝试
echo "<script>location.href='hotel2_galery.php'</script>";
而不是
header("location:hotel2_galery.php");
这是一个临时修复。如果您向我们展示完整的代码,我们可能会为您提供进一步的帮助。