php tags half removed

Last post 11-18-2009, 11:49 AM by Adam. 7 replies.
Sort Posts: Previous Next
  •  05-21-2008, 10:31 PM 40653

    php tags half removed

    I'm having a problem with CE replacing code that is in my content. For example when I load something like this.
     
     
    <?php include "header.php"; ?>
    This is some content.
     
     
    The editor removes the opening PHP tag but leaves the rest. If I use htmlentities then I only get the straight code, is there  a way for the editor to render the HTML and ignore anything that is wrapped in the php brackets?
     
    I am ripping the content out of files not a db:
     
            <?php
                $editor=new CuteEditor();
                $editor->ID="Editor1";
                $editor->Text=file_get_contents($file);
                $editor->EditorBodyStyle="font:normal 12px arial;";
                $editor->EditorWysiwygModeCss="php.css";
                $editor->AutoConfigure="Full";
                $editor->FilesPath="CuteEditor_Files";
                $editor->Draw();
                $editor=null;
            ?>
  •  05-26-2008, 1:32 PM 40779 in reply to 40653

    Re: php tags half removed

    Set the following property to true then try again:
     

    Editor.AllowEditServerSideCode Property

    By default Cute Editor doesn't allow edit the Server side code. When this property is set to true, Cute Editor will allow edit the Server side code.

     


    Example Code

    <?php
             $editor=new CuteEditor();
             $editor->ID="Editor1";
             $editor->Text="Type here";
             $editor->FilesPath="CuteEditor_Files";
             $editor->AllowEditServerSideCode=true;
             $editor->Draw();
             $editor=null; 

             //use $_POST["Editor1"]to catch the data
    ?>

     

     


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  05-28-2008, 12:55 PM 40854 in reply to 40779

    Re: php tags half removed

    Thanks that solved half the problem :) I can add the php code in now but when I load an existing page into the editor it gets stripped out. Any ideas on this? Iam using php's file_get_contents() function to read it into the $editor=> Text like this. $file is a file path I have already set up earlier in the page

                $editor=new CuteEditor();
                $editor->ID="Editor1";
                $editor->Text=file_get_contents($file);
                $editor->FilesPath="CuteEditor_Files";
                $editor->AllowEditServerSideCode=true;
                $editor->Draw();
                $editor=null;
     
  •  05-28-2008, 1:12 PM 40855 in reply to 40854

    Re: php tags half removed

    I was wrong on that last part the editor is now removing all of the php code instead of just the opening php tag.
  •  05-28-2008, 1:43 PM 40859 in reply to 40855

    Re: php tags half removed

    If anyone else has this problem add these two lines into the LoadHTML function
     
            $s = str_replace("<?php","&lt;?php",$s);
            $s = str_replace("?>","?&gt;",$s);

    This will render the php code as a string, then make sure you replace them again in your write code and it all works. It's a total hack but seems to work fine.
  •  10-20-2009, 3:39 PM 56528 in reply to 40859

    Re: php tags half removed

    This still seems to be an issue...
     
    I have
       theEditor.AllowEditServerSideCode = true;
     
    But when I load 
       theEditor.Text = "<?php .....  ?>" ;
     
     
    The editor is shows up blank. There is no text visible and even when I switch to HTML view, nothing shows up.
     
    Any idea how to get around this and actually display  "<?php .....  ?>"?
  •  11-17-2009, 3:36 PM 57224 in reply to 56528

    Re: php tags half removed

    Hi, I posted this last month. Any updates?
     
    I have
       theEditor.AllowEditServerSideCode = true;
     
    But when I load 
       theEditor.Text = "<?php .....  ?>" ;
     
     
    The editor is shows up blank. There is no text visible and even when I switch to HTML view, nothing shows up.
     
    Any idea how to get around this and actually display  "<?php .....  ?>"? 
  •  11-18-2009, 11:49 AM 57259 in reply to 57224

    Re: php tags half removed

    sincell:
    Hi, I posted this last month. Any updates?
     
    I have
       theEditor.AllowEditServerSideCode = true;
     
    But when I load 
       theEditor.Text = "<?php .....  ?>" ;
     
     
    The editor is shows up blank. There is no text visible and even when I switch to HTML view, nothing shows up.
     
    Any idea how to get around this and actually display  "<?php .....  ?>"? 
     
    Can you try the following demos?
     
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML