I'm setting up fckeditor right now and for the life of me can't get it to post.
Well actually it's posting as long as I follow the instructions at this article to a t

I'm trying to go a little beyond what it says in the article....I'm trying to get the id from the url and be able to post to the database based on that id. At the bottom of that page the last three posts are trying to figure out the same thing.

I've managed to get to the point where I can get the info from the database but can't post back. The exact code I'm using is at the bottom of that page. It seems it's what we're stuck on.

any ideas out there?

Thanks
Em

    10 months later

    Hello quantumphp, i have to finish with insert code. This is the code :

    <?php

    //This section should deal with the MagicQuotes and slashes
    function nukeMagicQuotes() {
    if (get_magic_quotes_gpc()) {
    function stripslashes_deep($value) {
    $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
    return $value;
    }
    $POST = array_map('stripslashes_deep', $POST);
    $GET = array_map('stripslashes_deep', $GET);
    $COOKIE = array_map('stripslashes_deep', $COOKIE);
    }
    }
    ?>
    <?php nukeMagicQuotes(); ?>
    <?php

    // Connect to the database
    $cnx = mysql_connect("localhost", "root", "") //change with your configuration
    OR die("Unable to connect to database!");
    mysql_select_db("dbfck", $cnx); //change with your configuration

    if ($POST['submit_form'] == 1) {
    // Save to the database.
    $data = mysql_real_escape_string(trim($
    POST['fcktext']));
    $res = mysql_query("INSERT INTO fck_data (data) VALUES ('$data')");

    if (!$res)
      die("Error saved record!  Mysql said: ".mysql_error());
    
    // Redirect to self to get rid of the POST
    header("Location: page.php"); // name of page when i want to redirect

    }

    include_once "../FCKeditor/fckeditor.php";
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Test FCKeditor</title>
    </head>
    <body>

    <h1>Test FCKeditor</h1>

    <form action="tambah.php" method="post">
    <?php
    // Get data from the database
    $query = mysql_query("SELECT data FROM fck_data WHERE id = '$id'");
    $data = mysql_fetch_array($query);

    // Configure and output editor
    $oFCKeditor = new FCKeditor('fcktext');
    $oFCKeditor->BasePath = "../FCKeditor/";
    $oFCKeditor->Value = $data["data"];
    $oFCKeditor->Width = 540;
    $oFCKeditor->Height = 400;
    echo $oFCKeditor->CreateHtml();
    ?>
    <br />
    <input type="hidden" name="submit_form" value="1" />
    <input type="submit" value="Save Form" />
    </form>

    </body>
    </html>

    <?php
    // Close the database connection
    mysql_close($cnx);
    ?>

      Write a Reply...