For some reason the html source (content) of the edited area is not posting through PHP. If I create something like "<b>test</b>" it appears on the next script as "test". What am I doing wrong?
---The Form
-----The PHP
---The Form
<script type="text/javascript" src="../WYSIWYG/ckeditor.js"></script> <form method="post" action="<? $_SERVER['SCRIPT_NAME']; ?>?action=update&id=<? echo $_GET['id']; ?>" onsubmit="var e = CKEDITOR.GetInstance('editor1'); e.UpdateLinkedField();"> <p> <textarea name="editor1" id="editor1"><? echo $content; ?></textarea> <script type="text/javascript"> CKEDITOR.replace( 'editor1' ); </script> </p> <p> <textarea name="test" cols="0" rows="0" id="test"></textarea> <input type="submit" value="Save Page" /> </p> </form>
-----The PHP
print_r($_POST); $content = $_POST['editor1']; $id = $_GET['id']; exit($content);
Re: Content Doesn't Post
I recommend to work with the getData() method.
http://docs.cksource.com/ckeditor_api/s ... ml#getData
Since CKEditor replaces the editing area with an editable iframe, you cannot handle it as a normal text input field.
You may write an ajax request instead of using the submit form button (jquery can be helpful here).
Re: Content Doesn't Post
Re: Content Doesn't Post
What I'm doing is saving it in a database, so when the page with the editor comes up, I recall the information from the database with PHP and simply decode the information before placing the information in the content of the editor. Probably not the best way and probably not the way it's supposed to be done, but it works for me.
The editor page.
The receiving page.