1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Having Issue with WYSIWYG editor

Discussion in 'PHP' started by LightM1, Jun 10, 2012.

  1. #1
    Hi I am having issue saving the edited page.

    The WYSIWYG editor is called CkEditor.

    This script is the Admin Section.
    <?php
    session_start();
    header("Cache-control: private");
    require_once ('../include/back.php');
    include_once("../ckeditor/ckeditor.php");?>
    <html>
    <head>
    <title>ADMIN</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
    </head>
    <body>
    <br>
    <p align="center" class="style4">
    <a href="logout.php">LOG OUT</a>
    </p>
    <form action="../home.php" method="post" target="_blank">
    <?php
    $CKEditor->basePath = '/ckeditor/';
    $CKEditor = new CKEditor();
    $CKEditor->editor("editor1", $initialValue);
    $initialValue = '<p>This is some <strong>sample text</strong>.</p>';
    ?>
    <input type="submit" value="Submit"/>
    </form>
    </body>
    </html>
    PHP:
    The second script is the front end

    <?php
    session_start();
    header("Cache-control: private");
    include("include/back.php");
    ?>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
    <link href="css/style1.css" type="text/css" rel="stylesheet">
    </head>
    <body>
    <div align="center">
    <table>
    <tr>
    <td>
    <?php
    $editor_data = $_POST[ 'editor1' ];
    echo $editor_data;
    ?>
    </td>
    </tr>
    </table>
    </body>
    </html>
    
    PHP:
    When I type something in the admin section, and submit the page it publish it but when I click on the menu it disappear.

    Is there a way that I can save the edited page? Any suggest? Any example and explanation will help me understand it better.

    Thanks
     
    Last edited: Jun 10, 2012
    LightM1, Jun 10, 2012 IP