Alright, so I have been banging my head for hours on this. Time to turn to the pros.
I am using jquery to post the serialized form.
I have ckeditor on a page, according to their instruction all I have to do is set the post to a variable and it will work. Well it doesn't. $_POST['TEXTAREA_NAME'] is empty.
alright, no problem. I can just use jquery to append the data to the textarea before the post takes place. now all i get is \r\n.
help please, what is the best way to get the data from ckeditor to mysql?
Text are:
<textarea id="content" name="content"><?php if($_GET['act'] == "edit"){ echo getDigestInfo($articleID, "content"); } ?></textarea>
Jquery:
function saveNew(){
$.post("crud/man-digest.php?act=add", $("#edit-content-form").serialize(),
function(data){
$("form .message").append(data);
}
,"json"
);
}
PHP:
$articleID = intval($_POST['id']);
// Perform Update
$article_title = mysql_prep($_POST['title']);
$article_content = mysql_prep($_POST['content']);
$article_system = mysql_prep($_POST['system']);
$article_updated = mysql_prep($_POST['updated']);
$article_datecreated = $_POST['datecreated'];
$query = "UPDATE techdigest SET
title = '{$article_title}',
content = '{$article_content}',
lastupdate = CURDATE(),
system = '{$article_system}',
datecreated = DATE('{$article_datecreated}')
WHERE id = {$articleID}";
$result = mysql_query($query);