This is my code so far
<?php
include("includes/connect.php");
$updateid = $_GET["id"];
include("includes/connect.php");
$editquery = mysql_query("SELECT * FROM news WHERE id = '$updateid'");
$row = mysql_fetch_assoc($editquery);
$currentid = $row["id"];
$currenttitle = $row["title"];
$currentdesc = $row["desc"];
$currentbody = $row["body"];
$currenttype = $row["type"];
$currentdate = $row["date"];
?>
<form style="margin:20px 0 0 0; padding:0;" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<label style="color:#000;">Title</label>
<input type="text" name="title" size="40" value="<?php echo "$currenttitle"; ?>" />
<label style="color:#000;">News Ticker Description</label>
<textarea cols="80" rows="10" name="desc"><?php echo "$currentdesc"; ?></textarea>
<label style="color:#000;">Body</label>
<?php
// Make sure you're using correct paths here
include_once 'ckeditor/ckeditor.php';
include_once 'ckfinder/ckfinder.php';
$ckeditor = new CKEditor();
$ckeditor->basePath = '/ckeditor/';
CKFinder::SetupCKEditor($ckeditor, '/ckfinder/');
$ckeditor->editor('body',$currentbody);
?>
<input style="margin:20px 0 0 0;" type="submit" name="submit" value="Submit" />
</form>
<?php
$submit = $_POST["submit"];
$updatetitle = $_POST['title'];
$updatebody = $_POST['body'];
$updatetype = $_POST['type'];
$updatedate = $_POST['date'];
$updatedesc = $_POST['desc'];
if ($submit) {
$updatearticle = mysql_query("UPDATE news SET title = '$updatetitle', desc = '$updatedesc', body = '$updatebody' WHERE id = $updateid")or die(mysql_error());
echo "<h1>Article has been updated</h1>";
}
?>
</div>
</div>
</div>
<?php
include("includes/footer.php"); ?>
</div>
</body>
</html>
MOD Edit:
. . .
tags added . . .