。對於數據庫我使用mysql。但是當我點擊提交按鈕提交表單時,數據庫正在更新,但是頁面沒有重定向到不同的位置。在使用CK編輯器進行更新後,頁面不會重定向
<?php
$sql="select * from automation_full";
$query=mysql_query($sql_get);
$row=mysql_fetch_object($query_get);
$old_content=$row->column1;
if(isset($_POST['save']))
{
$new_content=$_POST['content'];
$sql="update table1 set content='$new_content' where key_id=1";
$query=mysql_query($sql);
if($query)
{
header("Location:index.php");
}
}
?>
<div class="custom-container-right-form">
<form action="#" method="post">
<textarea id="text" name="content"></textarea>
<script>
CKEDITOR.replace('content');
</script>
<input type="submit" id="submit-button" name="save" value="Update">
</form>
</div>
當我點擊保存它應該更新表1和重定向到的index.php。但我的程序正在更新表,但不重定向到index.php ...但是當我不使用ck編輯器,它的工作完全正常....如何使它與ck編輯器一起工作?
你在控制檯中得到了什麼錯誤? –
沒有錯誤什麼那麼...查詢運行正常...表正在更新以及...但查詢執行後,該頁面不重定向到index.php ....它停留在相同的頁面.... –