Re: Absolute URL for Images and not HREF

  •  05-09-2011, 10:07 AM

    Re: Absolute URL for Images and not HREF

    Dear cosmonaut,
     
    Please follow steps:
     
    1. Save the following code to edithtml.php, and copy it to your cuteeditor installation folder
     
    <?php include_once("cuteeditor_files/include_CuteEditor.php") ; ?>
    <html> 
        <head>  
     </head>
        <body>
     <form name="theForm" action="Edithtml.php?postback=true" method="post">
              <?php
                    $editor=new CuteEditor();
                    $editor->ID="Editor1";
                    $editor->EditCompleteDocument=true;
                    $editor->URLType="Absolute";
                    if (@$_GET["postback"]!="true")
                   {
                    $editor->LoadHTML("document.html");
                          $editor->Draw();
                   }
                    else
                    {
                    $editor->SaveFile("document.html");
                    echo "this is atest";
                          $editor->Draw();
                    }
                    $editor=null;               
                    //use $_POST["Editor1"]to retrieve the data
                ?>
                    <textarea name="textbox1" rows="2" cols="20" id="textbox1" style="font-family:Arial;height:250px;width:730px;">
                          <?php echo @stripslashes($_POST["Editor1"]) ;?>
                </textarea> 
      </form>
     </body>
    </html>
     
    2. Run this example, and then replace the html code with the following one:
     
    <a name="test"></a>
    . . .
    <a href="#test">jump to test</a>
     
    3. Switch back to "Normal"
    4. Test it again, you will find href will not be changed, I have tested this today.
    You can download latest version and test this based on the latest version.
     
    Thank you for asking
View Complete Thread