RTE editor post to mysql

Hi i am trying to get arte editor to save data to mysql using a rte editor.
No matter how i try the post data is empty.
It’s driving me nuts i’ve googled for 2 days and not found a solution.
Surly missing something really simple.
Any help will be greatly appreciated

Geoff

<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {
    //make sure hidden and iframe values are in sync for all rtes before submitting form
    updateRTEs();
   
    return true;
}

//Usage: initRTE(imagesPath, includesPath, cssFile, genXHTML, encHTML)
initRTE("../rte/images/", "../rte/cbrte/", ".../rte/rte.css", true);
//-->
</script>
<noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>

<script language="JavaScript" type="text/javascript">
<!--
//build new richTextEditor
var rte1 = new richTextEditor('rte1');

//rte1.html = '';
rte1.toggleSrc = false;
rte1.build();
//-->
</script>
              if(isset($_POST'Submit']) && isset($_POST'rte1']))
            {
            $newsDate=date('Y-m-d');
            $heading=($_POST'heading']);
            $newsText = $_POST'rte1'];
            $addNews=mysql_query("INSERT INTO news (newsDate,newsHeader,newsText) VALUES('$newsDate','$heading','$newsText')")
            or die('Error, query failed.' . mysql_error());
            }

The form HTML code is also important for the issue because something as simples as method=“GET” instead of POST could get the cause.

Try creating a second page with

<?php

phpinfo();

?>

If you point the action="…" of your form to that page you can see exactly what is being submitted and where.

It’s nothing to do with php not working and $_GET and $_POST work with the form if i use a normal text area it’s only the rte editor that returns nothing

Geoff

There are a couple of things which occurr to me, first add something like this before your if statement:

if (is_null($_Post’rtel’])) echo “<h1>RTE is empty!</h1>”;

Second, how are you handling the special formatting characters in the RTE? I would’ve expected to see some code stripping them out before trying to insert them into the db. But the fact that you aren’t seeing the mysql_error message leads me to think its more likely the first issue.

HTH

(I should point out I dont actually use RTE - I use FCKEditor )

I was wondering if Geoff got resolution to this issue of no data in _POST. I have the same issue with the same code (cbrte, cross browser rich text editor, from Kevin Roth). The _POST array contains the variable ‘element’ but with a empty string. I made the mistake of inserting html code (<input name=“test” type=“hidden” value=“test”>) into the submit_form() function, and lo and behold, _POST had the data.