我目前正在使用CKEDITOR作为插件textarea,但问题是我每次使用CKEDITOR更新它会在URL上显示一堆html代码导致错误"414 ERROR URL TOO LONG"
如何解决这个问题?< / p>
我认为我的代码没有问题,问题就在于此 CKEDITOR正在为URL生成HTML代码。
感谢您的帮助。
<div class="row">
<div class="col-lg-12">
<div class="input-group"> <span class="input-group-addon">Filter</span>
<input id="filter" type="text" class="form-control" placeholder="Type here...">
</div>
<table id='deleteTable' class='table'>
<thead>
<tr>
<td>Title</td>
<td>Level</td>
<td>Chapter_ID</td>
<td>Edit</td>
<td>Delete</td>
</tr>
</thead>
<tbody id='myTable' class='searchable'>
<?php
include('../includes/connection/conn.php');
//MySQL Query to read data
$query = mysql_query("SELECT * from content", $connection);
while ($row = mysql_fetch_array($query)) {
echo"<tr>";
echo"<td>{$row['title']}</td>";
echo"<td>{$row['level']}</td>";
echo"<td>{$row['chapter_id']}</td>";
echo"<td><a href=\"managecontent.php?update={$row['id']}\"> <span class='glyphicon glyphicon-pencil'></span></a></td>";
echo "<td><a href=\"managecontent.php?delete={$row['id']}\"> <span class='glyphicon glyphicon-trash'></span></a></td>";
echo"</tr>";
}
?>
</tbody>
</table>
<?php
if (isset($_GET['submit'])) {
$id = $_GET['did'];
$title = $_GET['dtitle'];
$level = $_GET['dlevel'];
$chapter_id = $_GET['dchapter_id'];
$content= $_GET['dcontent'];//variable for updating content (CKEDITOR TEXTAREA)
$query = mysql_query("update content set
title='$title', level='$level',
contents='$content' where id='$id'", $connection);
}
?>
<!-- START UPDATE PART CODES -->
<?php
if (isset($_GET['update'])) {
$update = $_GET['update'];
$query1 = mysql_query("select * from content where id=$update", $connection);
while ($row1 = mysql_fetch_array($query1)) {
echo "<form class='form-horizontal' method='get'>";
echo"<div id='updatechapter' col-lg-12'>";
echo"<input class='input' type='hidden' name='did' value='{$row1['id']}' />";
echo"<h1> Update Content: </h1>";
echo"<label>Title:</label>";
echo"<input type='text' name='dtitle' value='{$row1['title']}' class='form-control' placeholder='eg. Basics of PHP'>";
echo"<label>Level:</label>";
echo"<select name='dlevel' class='form-control btn btn-primary'>";
echo"<option selected>Choose Category</option>";
echo"<option value='1'>Beginners</option>";
echo"<option value='2'>Advance</option>";
echo"<option value='3'>Expert</option>";
echo"</select>";
echo"<label>Chapter ID:</label>";
echo"<input type='text' name='dchapter_id' value='{$row1['chapter_id']}' class='form-control' placeholder='eg. Basics of PHP' readonly>";
//this is the plugin
echo"<label>Content:</label>";
echo"<textarea name='dcontent' id='Contents' rows='20'> {$row1['contents']} </textarea>";
echo"<script>";
echo"CKEDITOR.replace( 'Contents',{toolbarStartupExpanded : true} );";
echo"</script>";
echo"<br>";
echo"<button type='submit' name='submit' value='update' class='btn btn-danger form-control'><span class='glyphicon glyphicon-floppy-saved'></span> Save Changes</button>";
echo"</div>";
echo "</form>";
}
}
if (isset($_GET['submit'])) {
$message = "Data Updated Successfully!";
echo "<script> alert('{$message}'); </script>";
}
?>